2018-06-07 21:35:06 +00:00
|
|
|
{
|
|
|
|
"name": "Donation",
|
2020-02-08 18:29:10 +00:00
|
|
|
"description": "A representation of a donation to freeCodeCamp",
|
2018-07-30 18:58:36 +00:00
|
|
|
"plural": "donations",
|
2018-06-07 21:35:06 +00:00
|
|
|
"base": "PersistedModel",
|
|
|
|
"idInjection": true,
|
2018-07-30 18:58:36 +00:00
|
|
|
"scopes": {},
|
|
|
|
"indexes": {},
|
2018-06-07 21:35:06 +00:00
|
|
|
"options": {
|
|
|
|
"validateUpsert": true
|
2018-07-30 18:58:36 +00:00
|
|
|
},
|
|
|
|
"hidden": [],
|
|
|
|
"remoting": {},
|
|
|
|
"http": {},
|
2018-06-07 21:35:06 +00:00
|
|
|
"properties": {
|
|
|
|
"email": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true,
|
|
|
|
"description": "The email used to create the donation"
|
|
|
|
},
|
|
|
|
"provider": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true,
|
|
|
|
"description": "The payment handler, paypal/stripe etc..."
|
|
|
|
},
|
|
|
|
"amount": {
|
|
|
|
"type": "number",
|
|
|
|
"required": true,
|
|
|
|
"description": "The donation amount in cents"
|
|
|
|
},
|
2019-11-06 13:32:20 +00:00
|
|
|
"duration": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-06-07 21:35:06 +00:00
|
|
|
"startDate": {
|
|
|
|
"type": "DateString",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
"endDate": {
|
|
|
|
"type": "DateString"
|
|
|
|
},
|
|
|
|
"subscriptionId": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true,
|
|
|
|
"description": "The donation subscription id returned from the provider"
|
|
|
|
},
|
|
|
|
"customerId": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true,
|
2020-02-08 18:29:10 +00:00
|
|
|
"description": "The providers reference for the donor"
|
2018-06-07 21:35:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"validations": [
|
|
|
|
{
|
|
|
|
"amount": {
|
|
|
|
"type": "number",
|
|
|
|
"description": "Amount should be >= $1 (100c)",
|
|
|
|
"min": 100
|
2018-07-30 18:58:36 +00:00
|
|
|
},
|
|
|
|
"facetName": "server"
|
2018-06-07 21:35:06 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"relations": {
|
|
|
|
"user": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "user",
|
|
|
|
"foreignKey": "userId"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"acls": [],
|
2018-07-30 18:58:36 +00:00
|
|
|
"methods": {}
|
2018-06-07 21:35:06 +00:00
|
|
|
}
|