Modelos loopback

This commit is contained in:
Juan Ferrer Toribio 2017-05-09 14:04:44 +02:00
parent 0da217e9bc
commit 0efdd3565e
18 changed files with 142 additions and 209 deletions

View File

@ -20,7 +20,7 @@
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<vn-autocomplete vn-one
field="addressData.address.province"
field="addressData.address.provinceFk"
url="/client/api/Provinces"
show-field="name"
value-field="id"
@ -29,8 +29,8 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
field="addressData.address.agency"
url="/client/api/Agencies"
field="addressData.address.agencyFk"
url="/client/api/AgencyServices"
show-field="name"
value-field="id"
label="Agencia">

View File

@ -22,7 +22,7 @@
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<vn-autocomplete vn-one
field="addressData.address.province"
field="addressData.address.provinceFk"
url="/client/api/Provinces"
show-field="name"
value-field="id"
@ -31,8 +31,8 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
field="addressData.address.defaultAgency"
url="/client/api/Agencies"
field="addressData.address.defaultAgencyFk"
url="/client/api/AgencyServices"
show-field="name"
value-field="id"
label="Agencia">

View File

@ -22,7 +22,7 @@
<vn-horizontal>
<vn-textfield vn-one label="Email" field="$ctrl.client.email"></vn-textfield>
<vn-autocomplete vn-one
field="$ctrl.client.salesPerson"
field="$ctrl.client.salesPersonFk"
url="/client/api/Employees"
show-field="name"
value-field="id"

View File

@ -7,7 +7,7 @@ export const COMPONENT = {
controllerAs: 'card',
controller: function($http, $stateParams) {
this.client = null;
$http.get(`/client/api/Clients/${$stateParams.id}?filter[include][account]`).then(
$http.get(`/client/api/Clients/${$stateParams.id}?filter[include][accountFk]`).then(
json => this.client = json.data
);

View File

@ -20,14 +20,14 @@
<vn-horizontal>
<vn-textfield vn-one label="Código postal" field="fiscal.client.postcode"></vn-textfield>
<vn-autocomplete vn-one
field="fiscal.client.province"
field="fiscal.client.provinceFk"
url="/client/api/Provinces"
show-field="name"
value-field="id"
label="Provincia">
</vn-autocomplete>
<vn-autocomplete vn-one
field="fiscal.client.country"
field="fiscal.client.countryFk"
url="/client/api/Countries"
show-field="name"
value-field="id"
@ -42,7 +42,7 @@
<vn-horizontal>
<vn-textfield vn-two label="IBAN" field="fiscal.client.iban"></vn-textfield>
<vn-autocomplete vn-two
field="fiscal.client.payMethod"
field="fiscal.client.payMethodFk"
url="/client/api/PayMethods"
show-field="name"
value-field="id"
@ -52,9 +52,8 @@
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Crédito" field="fiscal.client.credit"></vn-textfield>
<vn-textfield vn-one label="CyC" field="fiscal.client.cyc"></vn-textfield>
<vn-textfield vn-one label="IAE" field="fiscal.client.gestdoc"></vn-textfield>
<vn-check vn-two label="Recargo de equivalencia" field="fiscal.client.surcharge"></vn-check>
<vn-textfield vn-one label="Crédito asegurado" field="fiscal.client.creditInsurance"></vn-textfield>
<vn-check vn-three label="Recargo de equivalencia" field="fiscal.client.surcharge"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -3,8 +3,8 @@
<vn-title>Notas</vn-title>
<vn-horizontal ng-repeat="n in observation.observations" margin-small-bottom style="align-items: center;">
<vn-auto style="border-radius: .3em;" class="pad-small border-solid">
<div class="notes-date">{{n.creationDate | date:'dd/MM/yyyy HH:mm'}}</div>
<div class="notes-date">{{n.salesPerson}}</div>
<div class="notes-date">{{n.creationTime | date:'dd/MM/yyyy HH:mm'}}</div>
<div class="notes-date">{{n.employeeFk}}</div>
<div>{{n.text}}</div>
</vn-auto>
</vn-horizontal>

View File

@ -17,7 +17,7 @@ export const COMPONENT = {
};
this.getObservation = function(clientId) {
let json = JSON.stringify({where: {client: this.client.id}, order: 'creationDate DESC'});
let json = JSON.stringify({where: {clientFk: this.client.id}, order: 'creationTime DESC'});
$http.get(`/client/api/clientObservations?filter=${json}`).then(
json => {
this.observations = json.data;

154
db.json
View File

@ -1,154 +0,0 @@
{
"ids": {
"User": 2,
"AccessToken": 4,
"Client": 24,
"PaymentMethod": 4,
"SalesPerson": 11,
"Address": 87,
"Country": 10,
"Province": 44,
"Agency": 4,
"Account": 32,
"ACL": 2,
"ClientObservation": 1274
},
"models": {
"User": {
"1": "{\"password\":\"$2a$10$af5k9noiG1GqxxTE9tyO4OJg/Bx1BZYm3d0sRf1gNlC57k9AK5ApK\",\"email\":\"admin@admin.com\",\"id\":1}"
},
"AccessToken": {
"0uzVYECqoa1aMAp4J74rsIIrmYqJtElgcDMOFL3kIaCrL09ljpurb1ad0kx7AjAr": "{\"id\":\"0uzVYECqoa1aMAp4J74rsIIrmYqJtElgcDMOFL3kIaCrL09ljpurb1ad0kx7AjAr\",\"ttl\":1209600,\"created\":\"2017-03-07T17:48:58.156Z\",\"userId\":1}",
"8KixErWXUSEU78jQp96OIRPAs8i9rWUITkbjTyUXaJfGiCQddh3lGYnfq1TKNYRh": "{\"id\":\"8KixErWXUSEU78jQp96OIRPAs8i9rWUITkbjTyUXaJfGiCQddh3lGYnfq1TKNYRh\",\"ttl\":1209600,\"created\":\"2017-03-14T08:07:52.112Z\",\"userId\":1}"
},
"Client": {
"12": "{\"name\":\"Verdnatura\",\"id\":12,\"fi\":\"B97367486\",\"salesPerson\":8,\"telefono\":\"963242100\",\"socialName\":\"Verdnatura Levante SL\",\"active\":true,\"user\":\"verdnatura\",\"fax\":\"963242100\",\"phone\":\"963242101\",\"email\":\"informatica@verdnatura.es\",\"surcharge\":true,\"cyc\":321,\"credit\":1000,\"iban\":\"456\",\"street\":\"Avenida Espioca, 100\",\"city\":\"Silla\",\"postcode\":\"1234567\",\"mobile\":\"654654654\",\"dueDay\":321,\"gestdoc\":23452343,\"province\":3,\"country\":1,\"modify\":\"BasicData\",\"navigate\":true,\"payMethod\":\"1\",\"coreVnh\":true,\"coreVnl\":true,\"invoiceByEmail\":true}",
"14": "{\"name\":\"Leopoldo Martin\",\"id\":14,\"street\":\"Casa\",\"fi\":\"1234567890A\",\"socialName\":\"Leopoldo\",\"fax\":\"963242100\",\"dischargeDate\":\"01/01/2017\",\"telefono\":\"963242100\",\"salesPerson\":\"2\",\"email\":\"leomartin@verdnatura.es\",\"city\":\"Benicull\",\"postcode\":\"123\",\"phone\":\"963215469\",\"mobile\":\"667985632\",\"credit\":2345,\"cyc\":56,\"iban\":\"asdf\",\"dueDay\":345,\"gestdoc\":2435,\"surcharge\":true,\"navigate\":true,\"province\":6,\"country\":2,\"payMethod\":1}",
"15": "{\"name\":\"Florsiteria Pepa\",\"fi\":\"12341234rasf\",\"socialName\":\"asdfasd\",\"dueDay\":5,\"id\":15,\"payMethod\":\"2\",\"salesPerson\":\"1\",\"modify\":\"BasicData\",\"iban\":\"sdfgsdfgsdfg\",\"email\":\"pepa@flores.es\",\"phone\":\"963242101\",\"city\":\"Alfarp\",\"postcode\":\"46985\"}",
"16": "{\"name\":\"Floristeria Antonieta\",\"fi\":\"2345234523d\",\"socialName\":\"23452345assdfgsdfgt\",\"active\":true,\"dueDay\":5,\"id\":16,\"modify\":\"FiscalData\",\"email\":\"antonieta@gmail.com\",\"phone\":\"654654654\",\"mobile\":\"654456456\",\"fax\":\"456456456\",\"street\":\"asdfasdf\",\"salesPerson\":8,\"city\":\"Albalat de la Ribera\",\"postcode\":\"46532\"}",
"19": "{\"name\":\"Planticas Eustaquio\",\"fi\":\"789456123B\",\"socialName\":\"Eustaquio Martinez\",\"active\":true,\"dueDay\":5,\"id\":19,\"email\":\"peustaquio@hotmail.es\",\"city\":\"Polinya\",\"postcode\":\"46231\",\"phone\":\"963215486\"}",
"21": "{\"name\":\"Ramos Antonieta\",\"fi\":\"B89564289\",\"socialName\":\"Antonia SL\",\"active\":true,\"dueDay\":5,\"id\":21,\"email\":\"ramos@rantonieta.es\",\"salesPerson\":8,\"phone\":\"986574232\"}",
"22": "{\"name\":\"Plantas Raimundo\",\"fi\":\"2536418B\",\"socialName\":\"Plantas Raimundo SL\",\"dueDay\":5,\"id\":22,\"email\":\"jose@plantasraimundo.com\",\"phone\":\"963254289\",\"mobile\":\"641967586\",\"salesPerson\":3,\"city\":\"Sueca\",\"postcode\":\"46985\"}",
"23": "{\"name\":\"ddddddddd\",\"fi\":\"sdsdsd\",\"socialName\":\"sdsdsd\",\"dueDay\":5,\"id\":23}"
},
"PaymentMethod": {
"1": "{\"name\":\"Tarjeta\",\"id\":1}",
"2": "{\"name\":\"Giro Bancario\",\"id\":2}",
"3": "{\"name\":\"Transferencia\",\"id\":3}"
},
"SalesPerson": {
"1": "{\"id\":1,\"name\":\"Jesus Brocal\"}",
"2": "{\"name\":\"Juan Carlos Lorenzo\",\"id\":2}",
"3": "{\"name\":\"Carlos Zambrano\",\"id\":3}",
"4": "{\"name\":\"Juan Ferrer\",\"id\":4}",
"5": "{\"name\":\"Javi Gallego\",\"id\":5}",
"6": "{\"name\":\"Vicente Falco\",\"id\":6}",
"7": "{\"name\":\"Nelo Sanchez\",\"id\":7}",
"8": "{\"name\":\"Francisco Natek\",\"id\":8}",
"9": "{\"name\":\"Silverio Rodriguez\",\"id\":9}",
"10": "{\"name\":\"Manoli\",\"id\":10}"
},
"Address": {
"57": "{\"street\":\"Avda Espioca\",\"consignee\":\"Vicente\",\"city\":\"Silla\",\"postcode\":\"46900\",\"phone\":\"963242100\",\"province\":\"1\",\"agency\":\"3\",\"id\":57,\"enabled\":true,\"default\":true}",
"58": "{\"street\":\"asdfasdfsdf\",\"consignee\":\"oiaspjdfopasidjfopsj\",\"city\":\"asdfasd\",\"postcode\":\"46460\",\"enabled\":true,\"phone\":\"23423342\",\"mobile\":\"234423\",\"default\":false,\"province\":\"19\",\"agency\":\"1\",\"client\":\"16\",\"id\":58}",
"59": "{\"street\":\"asdfasdf\",\"consignee\":\"asdfasdfasdf\",\"city\":\"sdfasdf\",\"postcode\":\"asdfa\",\"enabled\":true,\"phone\":\"a\",\"province\":\"14\",\"agency\":\"3\",\"client\":\"16\",\"id\":59,\"default\":false}",
"60": "{\"street\":\"asdfasdf\",\"consignee\":\"aasdfasdf\",\"city\":\"asdf\",\"postcode\":\"asdf\",\"enabled\":false,\"default\":false,\"province\":\"3\",\"client\":\"16\",\"id\":60}",
"61": "{\"street\":\"Avenida Espioca, 100\",\"consignee\":\"Verdnatura\",\"city\":\"Silla\",\"postcode\":\"46013\",\"enabled\":true,\"province\":1,\"agency\":\"2\",\"client\":\"12\",\"id\":61,\"phone\":\"963242100\",\"mobile\":\"687654321\"}",
"63": "{\"street\":\"Avd. Espioca nº 100\",\"consignee\":\"Verndatura Silla\",\"city\":\"Silla\",\"postcode\":\"46460\",\"phone\":\"66666666\",\"mobile\":\"989898888\",\"id\":63,\"province\":\"2\",\"agency\":\"3\",\"default\":false,\"enabled\":false}",
"78": "{\"street\":\"a\",\"consignee\":\"a\",\"city\":\"a\",\"enabled\":true,\"id\":78}",
"79": "{\"street\":\"a\",\"consignee\":\"a\",\"city\":\"a\",\"enabled\":true,\"id\":79}",
"80": "{\"street\":\"b\",\"consignee\":\"a\",\"city\":\"c\",\"enabled\":true,\"id\":80}",
"81": "{\"street\":\"street\",\"consignee\":\"consignee\",\"city\":\"city\",\"enabled\":true,\"id\":81}",
"82": "{\"street\":\"Polígono\",\"consignee\":\"Verdnatura Levante SL\",\"city\":\"Picasent\",\"enabled\":true,\"client\":12,\"id\":82,\"province\":1,\"agency\":2,\"phone\":\"963242100\",\"mobile\":\"698357618\"}",
"83": "{\"street\":\"San Nicolau de Bari, 6\",\"consignee\":\"Casa\",\"city\":\"Algemesi\",\"postcode\":\"46680\",\"enabled\":true,\"phone\":\"962480949\",\"client\":12,\"province\":1,\"agency\":1,\"id\":83,\"mobile\":\"658965745\"}",
"84": "{\"street\":\"Poligono\",\"consignee\":\"Madrid\",\"city\":\"Madrid\",\"enabled\":true,\"client\":12,\"id\":84,\"postcode\":\"46001\",\"province\":2,\"agency\":2,\"phone\":\"912356489\",\"mobile\":\"654236589\"}",
"85": "{\"street\":\"Avenida la Parra, 43\",\"consignee\":\"Ramos Antonienta\",\"city\":\"Llombai\",\"enabled\":true,\"client\":21,\"province\":1,\"id\":85,\"phone\":\"965874583\",\"mobile\":\"675418958\",\"postcode\":\"46985\",\"agency\":2,\"default\":true}",
"86": "{\"street\":\"Poligono industrial\",\"consignee\":\"Verdnatura\",\"city\":\"Barcelona\",\"enabled\":true,\"client\":12,\"province\":7,\"agency\":2,\"id\":86}"
},
"Country": {
"1": "{\"id\":1,\"name\":\"Spain\"}",
"2": "{\"id\":2,\"name\":\"France\"}",
"3": "{\"name\":\"Italy\",\"id\":3}",
"4": "{\"name\":\"Germany\",\"id\":4}",
"5": "{\"name\":\"Portugal\",\"id\":5}",
"6": "{\"name\":\"Netherlands\",\"id\":6}",
"7": "{\"name\":\"Colombia\",\"id\":7}",
"8": "{\"name\":\"Mexico\",\"id\":8}",
"9": "{\"name\":\"USA\",\"id\":9}"
},
"Province": {
"1": "{\"id\":1,\"name\":\"Valencia\"}",
"2": "{\"id\":2,\"name\":\"Madrid\"}",
"3": "{\"id\":3,\"name\":\"Alicante\"}",
"4": "{\"id\":4,\"name\":\"Castellon\"}",
"5": "{\"id\":5,\"name\":\"Murcia\"}",
"6": "{\"id\":6,\"name\":\"Albacete\"}",
"7": "{\"id\":7,\"name\":\"Barcelona\"}",
"8": "{\"id\":8,\"name\":\"Tarragona\"}",
"9": "{\"id\":9,\"name\":\"Gerona\"}",
"10": "{\"id\":10,\"name\":\"Granada\"}",
"11": "{\"id\":11,\"name\":\"Guadalajara\"}",
"12": "{\"id\":12,\"name\":\"Cuenca\"}",
"13": "{\"id\":13,\"name\":\"Asturias\"}",
"14": "{\"id\":14,\"name\":\"Almería\"}",
"15": "{\"id\":15,\"name\":\"Ávila\"}",
"16": "{\"id\":16,\"name\":\"Badajoz\"}",
"17": "{\"id\":17,\"name\":\"Burgos\"}",
"18": "{\"id\":18,\"name\":\"Málaga\"}",
"19": "{\"id\":19,\"name\":\"Navarra\"}",
"20": "{\"id\":20,\"name\":\"Ceuta\"}",
"22": "{\"id\":22,\"name\":\"Melilla\"}",
"23": "{\"id\":23,\"name\":\"Zaragoza\"}",
"24": "{\"id\":24,\"name\":\"Zamora\"}",
"25": "{\"id\":25,\"name\":\"Vizcaya\"}",
"26": "{\"id\":26,\"name\":\"Valladolid\"}",
"27": "{\"id\":27,\"name\":\"Toledo\"}",
"28": "{\"id\":28,\"name\":\"Teruel\"}",
"29": "{\"id\":29,\"name\":\"Santa Cruz de Tenerife\"}",
"30": "{\"id\":30,\"name\":\"Soria\"}",
"31": "{\"id\":31,\"name\":\"Sevilla\"}",
"32": "{\"id\":32,\"name\":\"Segovia\"}",
"33": "{\"id\":33,\"name\":\"Salamanca\"}",
"34": "{\"id\":34,\"name\":\"La Rioja\"}",
"35": "{\"id\":35,\"name\":\"Pontevedra\"}",
"36": "{\"id\":36,\"name\":\"Las Palmas\"}",
"37": "{\"id\":37,\"name\":\"Palencia\"}",
"38": "{\"id\":38,\"name\":\"Orense\"}",
"39": "{\"id\":39,\"name\":\"Lugo\"}",
"40": "{\"id\":40,\"name\":\"Lérida\"}",
"41": "{\"id\":41,\"name\":\"León\"}",
"42": "{\"id\":42,\"name\":\"Jaén\"}",
"43": "{\"id\":43,\"name\":\"Baleares\"}"
},
"Agency": {
"1": "{\"name\":\"Zeleris\",\"id\":1}",
"2": "{\"name\":\"MRW\",\"id\":2}",
"3": "{\"name\":\"DHL\",\"id\":3}"
},
"Account": {
"1": "{\"id\":1,\"password\":\"joselito\",\"name\":\"asdf\"}",
"12": "{\"id\":12,\"name\":\"verdnatura\",\"modify\":\"WebAccess\",\"password\":\"123\"}"
},
"ClientObservation": {
"1258": "{\"text\":\"Nota de prueba 1\",\"creationDate\":\"2017-01-17T15:24:23.320Z\",\"client\":12,\"salesPerson\":\"user\",\"id\":1258}",
"1259": "{\"text\":\"Nota de prueba 2\",\"creationDate\":\"2017-01-17T15:26:47.348Z\",\"client\":12,\"salesPerson\":\"user\",\"id\":1259}",
"1260": "{\"text\":\"sss\",\"creationDate\":\"2017-01-17T15:33:29.068Z\",\"client\":14,\"salesPerson\":\"user\",\"id\":1260}",
"1261": "{\"text\":\"Nota 2\",\"creationDate\":\"2017-01-17T15:35:06.313Z\",\"client\":14,\"salesPerson\":\"user\",\"id\":1261}",
"1262": "{\"text\":\"Nota 3\",\"creationDate\":\"2017-01-17T15:35:10.602Z\",\"client\":14,\"salesPerson\":\"user\",\"id\":1262}",
"1263": "{\"text\":\"Nota 4\",\"creationDate\":\"2017-01-17T15:35:44.768Z\",\"client\":14,\"salesPerson\":\"user\",\"id\":1263}",
"1264": "{\"text\":\"Nota 5\",\"creationDate\":\"2017-01-17T15:35:50.064Z\",\"client\":14,\"salesPerson\":\"user\",\"id\":1264}",
"1265": "{\"text\":\"primera nota\",\"creationDate\":\"2017-01-20T10:23:28.000Z\",\"client\":\"16\",\"salesPerson\":\"user\",\"modify\":\"ClientObservation\",\"id\":1265}",
"1266": "{\"text\":\"segunda nota\",\"creationDate\":\"2017-01-20T10:23:37.000Z\",\"client\":\"16\",\"salesPerson\":\"user\",\"modify\":\"ClientObservation\",\"id\":1266}",
"1267": "{\"text\":\"tercera nota\",\"creationDate\":\"2017-01-20T10:23:53.000Z\",\"client\":\"16\",\"salesPerson\":\"user\",\"modify\":\"ClientObservation\",\"id\":1267}",
"1268": "{\"text\":\"dsfasdf asf asfdasf sda fdsadf adsf sdafh sdalfhsdlafd haslkfhalsfh alskdhf lasdkfh laskf hlaskdhf lkadsh lkasdhfla ksdhf lsdfh askldfh lasf hsald fhasldf hsalkhf lsdh flkshf lskdhf lskdfh lskf hlsfh lasdkhf lskhf laskfh lsaf ksdh flshf lkashf lsakhf laskfh lsakdhf laskdf hlaskdfh laskhfd lasf hlaskfh lasdkhf laskdf hlsad fhskfhaslkdfh askdfh asklf lsakdf\",\"creationDate\":\"2017-01-23T08:14:58.000Z\",\"client\":\"17\",\"salesPerson\":\"user\",\"modify\":\"ClientObservation\",\"id\":1268}",
"1269": "{\"text\":\"yyyyy\",\"creationDate\":\"2017-02-07T09:11:11.000Z\",\"id\":1269}",
"1270": "{\"text\":\"7777\",\"creationDate\":\"2017-02-07T09:12:13.000Z\",\"id\":1270}",
"1271": "{\"text\":\"dddd\",\"creationDate\":\"2017-02-07T09:12:39.000Z\",\"id\":1271}"
},
"ACL": {
"1271": "{\"text\":\"dddd\",\"creationDate\":\"2017-02-07T09:12:39.000Z\",\"id\":1271}",
"1272": "{\"text\":\"12121\",\"creationDate\":\"2017-03-09T13:29:01.000Z\",\"id\":1272}",
"1273": "{\"text\":\"23232323232323\",\"creationDate\":\"2017-03-09T13:29:28.000Z\",\"id\":1273}"
}
}
}

View File

@ -8,6 +8,9 @@
"id": true,
"description": "Identifier"
},
"clientFk": {
"type": "Number"
},
"consignee": {
"type": "string",
"required": true
@ -23,7 +26,7 @@
"postcode": {
"type": "string"
},
"province": {
"provinceFk": {
"type": "Number"
},
"phone": {
@ -38,23 +41,29 @@
"default": {
"type": "boolean"
},
"defaultAgency": {
"defaultAgencyFk": {
"type": "Number"
},
"longitude": {
"type": "Number"
},
"latitude": {
"type": "Number"
}
},
"validations": [],
"relations": {
"country": {
"type": "belongsTo",
"countryFk": {
"type": "hasOne",
"model": "Country",
"foreignKey": "id"
},
"client": {
"clientFk": {
"type": "hasOne",
"model": "Client",
"foreignKey": "id"
},
"defaultAgency": {
"defaultAgencyFk": {
"type": "hasOne",
"model": "Agency",
"foreignKey": "id"

View File

@ -1,5 +1,5 @@
{
"name": "Agency",
"name": "AgencyService",
"base": "PersistedModel",
"validateUpsert": true,
"properties": {
@ -11,6 +11,24 @@
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
},
"agencyTypeFk": {
"type": "Number"
},
"m3": {
"type": "Number"
},
"agencyFk": {
"type": "Number"
},
"inflation": {
"type": "Number"
},
"sendMailTo": {
"type": "string"
}
},
"acls": [

View File

@ -130,7 +130,7 @@ module.exports = function(Client) {
Client.addressesList = function(id, p, cb) {
let filter = {
where: {
client: id,
clientFk: id,
},
skip: (p.page - 1) * p.size,
limit: p.size

View File

@ -26,7 +26,7 @@
"socialName": {
"type": "string"
},
"registerDate": {
"creationTime": {
"type": "string"
},
"contact": {
@ -38,15 +38,15 @@
"city": {
"type": "string"
},
"province": {
"type": "Number"
},
"country": {
"type": "Number"
},
"postcode": {
"type": "string"
},
"provinceFk": {
"type": "Number"
},
"countryFk": {
"type": "Number"
},
"email": {
"type": "string"
},
@ -65,7 +65,7 @@
"credit": {
"type": "Number"
},
"cyc": {
"creditInsurance": {
"type": "Number"
},
"iban": {
@ -74,9 +74,6 @@
"dueDay": {
"type": "Number"
},
"dms": {
"type": "Number"
},
"surcharge": {
"type": "boolean",
"description": "The client has equivalence surcharge"
@ -89,34 +86,64 @@
"type": "boolean",
"description": "Send invoices by email"
},
"payMethod": {
"payMethodFk": {
"type": "Number"
},
"salesPerson": {
"salesPersonFk": {
"type": "Number"
},
"contactChannelFk": {
"type": "Number"
},
"sepaVnl": {
"type": "boolean"
},
"coreVnl": {
"type": "boolean"
},
"coreVnh": {
"type": "boolean"
},
"eypbc": {
"type": "boolean"
},
"quality": {
"type": "Number"
},
"vies": {
"type": "Number"
},
"isRelevant": {
"type": "boolean"
},
"typeFk": {
"type": "Number"
},
"accountingAccount": {
"type": "string"
}
},
"validations": [],
"relations": {
"account": {
"accountFk": {
"type": "hasOne",
"model": "Account",
"foreignKey": "id"
},
"payMethod": {
"payMethodFk": {
"type": "hasOne",
"model": "PayMethod",
"foreignKey": "id"
},
"salesPerson": {
"salesPersonFk": {
"type": "hasOne",
"model": "Employee",
"foreignKey": "id"
},
"addresses": {
"addressesFk": {
"type": "hasMany",
"model": "Address",
"foreignKey": "client"
"foreignKey": "clientFk"
}
},
"acls": [

View File

@ -9,28 +9,28 @@
"id": true,
"description": "Identifier"
},
"clientFk": {
"type": "Number"
},
"employeeFk": {
"type": "Number"
},
"text": {
"type": "string",
"description": "Text"
},
"creationDate": {
"creationTime": {
"type": "date",
"description": "Creation Date"
},
"client": {
"type": "Number"
},
"salesPerson": {
"type": "Number"
"description": "Creation date and time"
}
},
"relations": {
"salesPerson": {
"employeeFk": {
"type": "hasOne",
"model": "Employee",
"foreignKey": "id"
},
"client": {
"clientFk": {
"type": "hasOne",
"model": "Client",
"foreignKey": "id"

View File

@ -11,6 +11,18 @@
"name": {
"type": "string",
"required": true
},
"inCee": {
"type": "Number"
},
"code": {
"type": "string"
},
"currencyFk": {
"type": "Number"
},
"realCountryFk": {
"type": "Number"
}
},
"acls": [

View File

@ -11,6 +11,10 @@
"name": {
"type": "string",
"required": true
},
"userFk": {
"type": "Number",
"required": true
}
},
"acls": [

View File

@ -11,6 +11,15 @@
"name": {
"type": "string",
"required": true
},
"graceDays": {
"type": "string"
},
"outstandingDebt": {
"type": "Number"
},
"ibanRequired": {
"type": "boolean"
}
},
"acls": [

View File

@ -11,10 +11,19 @@
"name": {
"type": "string",
"required": true
},
"countryFk": {
"type": "Number"
},
"warehouseFk": {
"type": "Number"
},
"zoneFk": {
"type": "Number"
}
},
"relations": {
"country": {
"countryFk": {
"type": "hasOne",
"model": "Country",
"foreignKey": "id"

View File

@ -50,7 +50,7 @@
"dataSource": "vn",
"public": true
},
"Agency": {
"AgencyService": {
"dataSource": "vn",
"public": true
},