feat(news): Add news model
This commit is contained in:
		
				
					committed by
					
						
						mrugesh mohapatra
					
				
			
			
				
	
			
			
			
						parent
						
							f46f06ccd6
						
					
				
				
					commit
					eba910e939
				
			
							
								
								
									
										5
									
								
								common/models/article.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								common/models/article.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
module.exports = function(Article) {
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										74
									
								
								common/models/article.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								common/models/article.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "article",
 | 
			
		||||
  "plural": "articles",
 | 
			
		||||
  "base": "PersistedModel",
 | 
			
		||||
  "idInjection": true,
 | 
			
		||||
  "options": {
 | 
			
		||||
    "validateUpsert": true
 | 
			
		||||
  },
 | 
			
		||||
  "properties": {
 | 
			
		||||
    "shortId": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "title": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "author": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "subtitle": {
 | 
			
		||||
      "type": "string"
 | 
			
		||||
    },
 | 
			
		||||
    "featureImage": {
 | 
			
		||||
      "type": "string"
 | 
			
		||||
    },
 | 
			
		||||
    "draft": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "renderableContent": {
 | 
			
		||||
      "type": "string"
 | 
			
		||||
    },
 | 
			
		||||
    "published": {
 | 
			
		||||
      "type": "boolean",
 | 
			
		||||
      "required": true,
 | 
			
		||||
      "default": false
 | 
			
		||||
    },
 | 
			
		||||
    "featured": {
 | 
			
		||||
      "type": "boolean",
 | 
			
		||||
      "required": true,
 | 
			
		||||
      "default": false
 | 
			
		||||
    },
 | 
			
		||||
    "underReview": {
 | 
			
		||||
      "type": "boolean",
 | 
			
		||||
      "required": true,
 | 
			
		||||
      "default": false
 | 
			
		||||
    },
 | 
			
		||||
    "viewCount": {
 | 
			
		||||
      "type": "number",
 | 
			
		||||
      "required": true,
 | 
			
		||||
      "default": 1
 | 
			
		||||
    },
 | 
			
		||||
    "createdDate": {
 | 
			
		||||
      "type": "date",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "lastEditedDate": {
 | 
			
		||||
      "type": "date",
 | 
			
		||||
      "required": true
 | 
			
		||||
    },
 | 
			
		||||
    "history": {
 | 
			
		||||
      "type": [
 | 
			
		||||
        "object"
 | 
			
		||||
      ],
 | 
			
		||||
      "required": true
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "validations": [],
 | 
			
		||||
  "relations": {},
 | 
			
		||||
  "acls": [],
 | 
			
		||||
  "methods": {}
 | 
			
		||||
}
 | 
			
		||||
@@ -92,7 +92,7 @@
 | 
			
		||||
      "type": "array",
 | 
			
		||||
      "default": []
 | 
			
		||||
    },
 | 
			
		||||
    "guideUrl" : {
 | 
			
		||||
    "guideUrl": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
      "description": "Used to link to an article in the FCC guide"
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -244,19 +244,23 @@
 | 
			
		||||
      },
 | 
			
		||||
      "default": {}
 | 
			
		||||
    },
 | 
			
		||||
    "donationEmails": [ "string" ],
 | 
			
		||||
    "donationEmails": {
 | 
			
		||||
      "type": [
 | 
			
		||||
        "string"
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "isDonating": {
 | 
			
		||||
      "type": "boolean",
 | 
			
		||||
      "default": false,
 | 
			
		||||
      "description": "Does the camper have an active donation"
 | 
			
		||||
      "description": "Does the camper have an active donation",
 | 
			
		||||
      "default": false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "validations": [],
 | 
			
		||||
  "relations": {
 | 
			
		||||
    "donations": {
 | 
			
		||||
      "type": "hasMany",
 | 
			
		||||
      "modal": "donation",
 | 
			
		||||
      "foreignKey": ""
 | 
			
		||||
      "foreignKey": "",
 | 
			
		||||
      "modal": "donation"
 | 
			
		||||
    },
 | 
			
		||||
    "credentials": {
 | 
			
		||||
      "type": "hasMany",
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,6 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "method-override": {}
 | 
			
		||||
 | 
			
		||||
  },
 | 
			
		||||
  "parse:after": {
 | 
			
		||||
    "./middlewares/validator": {}
 | 
			
		||||
 
 | 
			
		||||
@@ -86,5 +86,9 @@
 | 
			
		||||
  "User": {
 | 
			
		||||
    "dataSource": "db",
 | 
			
		||||
    "public": false
 | 
			
		||||
  },
 | 
			
		||||
  "article": {
 | 
			
		||||
    "dataSource": "db",
 | 
			
		||||
    "public": true
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,17 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "Donation",
 | 
			
		||||
  "plural": "donations",
 | 
			
		||||
  "description": "A representaion of a donation to freeCodeCamp",
 | 
			
		||||
  "plural": "donations",
 | 
			
		||||
  "base": "PersistedModel",
 | 
			
		||||
  "idInjection": true,
 | 
			
		||||
  "scopes": {},
 | 
			
		||||
  "indexes": {},
 | 
			
		||||
  "options": {
 | 
			
		||||
    "validateUpsert": true
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  "hidden": [],
 | 
			
		||||
  "remoting": {},
 | 
			
		||||
  "http": {},
 | 
			
		||||
  "properties": {
 | 
			
		||||
    "email": {
 | 
			
		||||
      "type": "string",
 | 
			
		||||
@@ -41,14 +46,14 @@
 | 
			
		||||
      "description": "The providers reference for the donator"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "hidden": [],
 | 
			
		||||
  "validations": [
 | 
			
		||||
    {
 | 
			
		||||
      "amount": {
 | 
			
		||||
        "type": "number",
 | 
			
		||||
        "description": "Amount should be >= $1 (100c)",
 | 
			
		||||
        "min": 100
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      "facetName": "server"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "relations": {
 | 
			
		||||
@@ -59,10 +64,5 @@
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "acls": [],
 | 
			
		||||
  "scopes": {},
 | 
			
		||||
  "indexes" : {},
 | 
			
		||||
  "methods": [],
 | 
			
		||||
  "remoting": {},
 | 
			
		||||
  "http": {}
 | 
			
		||||
  "methods": {}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user