chore: Remove unused files

This commit is contained in:
Bouncey
2019-02-16 11:37:52 +00:00
committed by mrugesh mohapatra
parent ec7df15c5f
commit 3f25ed051d
9 changed files with 0 additions and 552 deletions

View File

@ -1,32 +0,0 @@
{
"name": "flyer",
"base": "PersistedModel",
"idInjection": true,
"trackChanges": false,
"properties": {
"message": {
"type": "string"
},
"isActive": {
"type": "boolean",
"default": true
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
}

View File

@ -1,119 +0,0 @@
{
"name": "job",
"base": "PersistedModel",
"strict": true,
"idInjection": true,
"trackChanges": false,
"properties": {
"id": {
"type": "string",
"id": true
},
"position": {
"type": "string"
},
"company": {
"type": "string"
},
"logo": {
"type": "string"
},
"city": {
"type": "string"
},
"email": {
"type": "string",
"required": true
},
"phone": {
"type": "string"
},
"state": {
"type": "string"
},
"url": {
"type": "string"
},
"country": {
"type": "string"
},
"locale": {
"type": "string",
"required": true,
"description": "format: city, state"
},
"location": {
"type": "geopoint",
"description": "location in lat, long"
},
"description": {
"type": "string"
},
"isApproved": {
"type": "boolean",
"default": false
},
"isHighlighted": {
"type": "boolean",
"default": false
},
"isPaid": {
"type": "boolean",
"default": false
},
"isFilled": {
"type": "boolean",
"default": false
},
"postedOn": {
"type": "date",
"defaultFn": "now"
},
"isFrontEndCert": {
"type": "boolean",
"description": "Camper must be front end certified to apply",
"defaut": false
},
"isBackEndCert": {
"type": "boolean",
"description": "Camper must be back end certified to apply",
"default": false
},
"isFullStackCert": {
"type": "boolean",
"description": "Camper must be full stack certified to apply",
"default": false
},
"isRemoteOk": {
"type": "boolean",
"description": "Camper may work remotely",
"default": false
},
"howToApply": {
"type": "string",
"required": true,
"description": "How campers apply to a job"
},
"promoCodeUsed": {
"type": "string",
"description": "The promocode, if any, that the job uses"
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
}

View File

@ -1,84 +0,0 @@
import { isAlphanumeric, isMongoId } from 'validator';
import debug from 'debug';
const log = debug('fcc:models:promo');
export default function promo(Promo) {
Promo.getButton = function getButton(id, code, type = 'isNot') {
const Job = Promo.app.models.Job;
if (!id || !isMongoId('' + id)) {
return Promise.reject(new Error(
'Must include job id'
));
}
if (
!isAlphanumeric('' + code) &&
type &&
!isAlphanumeric('' + type)
) {
return Promise.reject(new Error(
'Code or Type should be an alphanumeric'
));
}
const query = {
where: {
and: [{
code: type === 'isNot' ? type : 'isHighlighted'
},
{
type: type.replace(/^\$/g, '')
}]
}
};
return Promo.findOne(query)
.then(function(promo) {
// turn promo model to plain js object;
promo = promo.toJSON();
return Job.updateAll({ id: id }, { promoCodeUsed: code })
.then(function({ count = 0 } = {}) {
log('job', count);
if (count) {
return {
...promo,
name: `${code} Discount`
};
}
return Promise.reject(new Error(
`Job ${id} not found`
));
});
});
};
Promo.remoteMethod(
'getButton',
{
description: 'Get button id for promocode',
accepts: [
{
arg: 'id',
type: 'string',
required: true
},
{
arg: 'code',
type: 'string',
required: true
},
{
arg: 'type',
type: 'string'
}
],
returns: [
{
arg: 'promo',
type: 'object'
}
]
}
);
}

View File

@ -1,59 +0,0 @@
{
"name": "promo",
"base": "PersistedModel",
"strict": true,
"idInjection": true,
"trackChanges": false,
"properties": {
"code": {
"type": "string",
"required": true,
"description": "The code to unlock the promotional discount"
},
"name": {
"type": "string",
"required": true,
"description": "The name of the discount"
},
"buttonId": {
"type": "string",
"required": true,
"description": "The ID of the paypal button"
},
"type": {
"type": "string",
"description": "A selector of different types of buttons for the same discount"
},
"fullPrice": {
"type": "number",
"required": true,
"description": "The original amount"
},
"discountAmount": {
"type": "number",
"description": "The amount of the discount if applicable"
},
"discountPercent": {
"type": "number",
"description": "The amount of the discount as a percentage if applicable"
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "getButton"
}
],
"methods": {}
}

View File

@ -1,81 +0,0 @@
{
"name": "story",
"base": "PersistedModel",
"idInjection": true,
"trackChanges": false,
"properties": {
"id": {
"type": "string",
"id": true
},
"name": {
"type": "string",
"index": {
"mongodb": {
"unique": true,
"background": true
}
}
},
"headline": {
"type": "string"
},
"timePosted": {
"type": "number",
"default": 0
},
"link": {
"type": "string"
},
"metaDescription": {
"type": "string",
"default": ""
},
"description": {
"type": "string"
},
"rank": {
"type": "number",
"default": 0
},
"upVotes": {
"type": "array",
"default": []
},
"author": {
"type": {}
},
"image": {
"type": "string",
"default": ""
},
"storyLink": {
"type": "string",
"default": ""
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW",
"property": "create"
}
],
"methods": {}
}