Entidades Client y Address, customer renombrado a client

This commit is contained in:
Juan Ferrer Toribio 2016-11-17 12:56:35 +01:00
parent 8e81cec20e
commit 0aac38f2ff
31 changed files with 124 additions and 150 deletions

View File

@ -1,9 +1,7 @@
{
"db": {
"name": "db",
"connector": "memory",
"file": "db.json"
}
}

View File

@ -17,3 +17,4 @@
coverage
node_modules
npm-debug.log
db.json

View File

@ -0,0 +1,32 @@
{
"name": "Address",
"base": "PersistedModel",
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"street": {
"type": "string",
"required": "true"
},
"city": {
"type": "string",
"required": "true"
},
"postcode": {
"type": "string"
},
"province": {
"type": "string"
},
"country": {
"type": "string",
"required": "true"
},
"phone": {
"type": "string"
}
}
}

View File

@ -0,0 +1,74 @@
{
"name": "Client",
"base": "PersistedModel",
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": "true"
},
"salesPerson": {
"type": "Number",
"required": "true"
},
"fi": {
"type": "string",
"description": "Fiscal indetifier"
},
"alias": {
"type": "string"
},
"socialName": {
"type": "string"
},
"dischargeDate": {
"type": "string"
},
"contact": {
"type": "string"
},
"email": {
"type": "string"
},
"phone": {
"type": "string"
},
"fax": {
"type": "string"
},
"quality": {
"type": "string"
},
"active": {
"type": "boolean"
},
"credit": {
"type": "Number"
},
"creditAndCaution": {
"type": "Number"
},
"iban": {
"type": "string"
},
"payMethod": {
"type": "string"
},
"surcharge": {
"type": "boolean",
"description": "The client has equivalence surcharge"
},
"hasToInvoice": {
"type": "boolean",
"description": "Global invoicing enabled for the client"
},
"invoiceByEmail": {
"type": "boolean",
"description": "Send invoices by email"
}
}
}

View File

@ -0,0 +1,7 @@
{
"db": {
"name": "db",
"connector": "memory",
"file": "db.json"
}
}

View File

@ -16,10 +16,6 @@
"User": {
"dataSource": "db"
},
"Customer": {
"dataSource": "db",
"public": true
},
"AccessToken": {
"dataSource": "db",
"public": false
@ -36,7 +32,12 @@
"dataSource": "db",
"public": false
},
"Message": {
"dataSource": null
"Client": {
"dataSource": "db",
"public": true
},
"Address": {
"dataSource": "db",
"public": true
}
}

View File

@ -1,14 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Salix</title>
</head>
<body ng-app="login">
<vn-login></vn-login>
<script
type="text/javascript"
src="/salix.customer.js">
</script>
</body>
</html>

View File

@ -1,15 +0,0 @@
{
"name": "AccessTokenIp",
"base": "AccessToken",
"idInjection": false,
"properties": {
"ip": {
"type": "string",
"default": "1.1.1.1"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}

View File

@ -1,18 +0,0 @@
{
"name": "UserIp",
"base": "User",
"properties": {},
"validations": [],
"relations": {
"accessTokens": {
"type": "hasMany",
"model": "AccessTokenIp",
"foreignKey": "userId",
"options": {
"disableInclude": true
}
}
},
"acls": [],
"methods": {}
}

View File

@ -1,30 +0,0 @@
{
"name": "Customer",
"properties": {
"name": {
"type": "String",
"required": "true"
},
"id": {
"type": "Number",
"id": true,
"description": "Customer ID"
}
},
"validations": [],
"relations": {},
"acls": [
{
"principalType": "ROLE",
"principalId": "$unauthenticated",
"permission": "DENY"
},
{
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "create"
}
],
"methods": {}
}

View File

@ -1,8 +0,0 @@
module.exports = function(Message) {
Message.greet = function(msg, cb) {
process.nextTick(function() {
msg = msg || 'hello';
cb(null, 'Sender says ' + msg + ' to receiver');
});
};
};

View File

@ -1,29 +0,0 @@
{
"name": "Message",
"base": "Model",
"properties": {},
"validations": [],
"relations": {},
"acls": [],
"methods": {
"greet": {
"isStatic": true,
"accepts": [
{
"arg": "msg",
"type": "string",
"http": {
"source": "query"
}
}
],
"returns": {
"arg": "greeting",
"type": "string"
},
"http": {
"verb": "get"
}
}
}
}

View File

@ -1,5 +0,0 @@
'use strict';
module.exports = function(Usera) {
};

View File

@ -1,13 +0,0 @@
{
"name": "UserA",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}

View File

@ -1,6 +0,0 @@
{
"db": {
"name": "db",
"connector": "memory"
}
}

View File

@ -38,7 +38,7 @@ http {
proxy_pass http://127.0.0.1:3001/$1$is_args$args;
}
location ~ ^/customer(?:/(.*))?$ {
location ~ ^/client(?:/(.*))?$ {
proxy_pass http://127.0.0.1:3002/$1$is_args$args;
}
}

View File

@ -16,12 +16,11 @@
"workingDir": "."
},
{
"uid": "customer",
"uid": "client",
"append": true,
"watch": true,
"script": "server.js",
"sourceDir": "./@salix-services/customer/server",
"sourceDir": "./@salix-services/client/server",
"workingDir": "."
}
]