From dc03c5f453d1ad3a5275de76b0919f8baa13f268 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Wed, 20 Dec 2017 09:53:50 +0100 Subject: [PATCH] modelos para el microservicio item --- services/item/common/models/ink.json | 28 +++++++++++++ services/item/common/models/intrastat.json | 32 +++++++++++++++ services/item/common/models/item.json | 20 +++++++++ services/item/common/models/origin.json | 23 +++++++++++ services/item/common/models/producer.json | 20 +++++++++ services/item/common/models/tax-class.json | 23 +++++++++++ services/item/common/models/tax-code.json | 47 ++++++++++++++++++++++ services/item/common/models/tax-type.json | 36 +++++++++++++++++ services/item/server/model-config.json | 24 +++++++++++ 9 files changed, 253 insertions(+) create mode 100644 services/item/common/models/ink.json create mode 100644 services/item/common/models/intrastat.json create mode 100644 services/item/common/models/origin.json create mode 100644 services/item/common/models/producer.json create mode 100644 services/item/common/models/tax-class.json create mode 100644 services/item/common/models/tax-code.json create mode 100644 services/item/common/models/tax-type.json diff --git a/services/item/common/models/ink.json b/services/item/common/models/ink.json new file mode 100644 index 000000000..52d6c22f8 --- /dev/null +++ b/services/item/common/models/ink.json @@ -0,0 +1,28 @@ +{ + "name": "Ink", + "base": "VnModel", + "options": { + "mysql": { + "table": "ink", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "String" + }, + "picture": { + "mysql": { + "dataType": "blob" + } + }, + "showOrder": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/intrastat.json b/services/item/common/models/intrastat.json new file mode 100644 index 000000000..0ef5c5876 --- /dev/null +++ b/services/item/common/models/intrastat.json @@ -0,0 +1,32 @@ +{ + "name": "Intrastat", + "base": "VnModel", + "options": { + "mysql": { + "table": "intrastat", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "description": { + "type": "String" + } + }, + "relations": { + "taxClass": { + "type": "belongsTo", + "model": "TaxClass", + "foreignKey": "taxClassFk" + }, + "taxCode": { + "type": "belongsTo", + "model": "TaxCode", + "foreignKey": "taxCodeFk" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/item.json b/services/item/common/models/item.json index 6db749227..2ea6707b6 100644 --- a/services/item/common/models/item.json +++ b/services/item/common/models/item.json @@ -46,6 +46,26 @@ "type": "belongsTo", "model": "ItemType", "foreignKey": "typeFk" + }, + "ink": { + "type": "belongsTo", + "model": "Ink", + "foreignKey": "inkFk" + }, + "origin": { + "type": "belongsTo", + "model": "Origin", + "foreignKey": "originFk" + }, + "producer": { + "type": "belongsTo", + "model": "Producer", + "foreignKey": "producerFk" + }, + "intrastat": { + "type": "belongsTo", + "model": "Intrastat", + "foreignKey": "intrastatFk" } } } \ No newline at end of file diff --git a/services/item/common/models/origin.json b/services/item/common/models/origin.json new file mode 100644 index 000000000..9ebeb98f8 --- /dev/null +++ b/services/item/common/models/origin.json @@ -0,0 +1,23 @@ +{ + "name": "Origin", + "base": "VnModel", + "options": { + "mysql": { + "table": "origin", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "code": { + "type": "String" + }, + "name": { + "type": "String" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/producer.json b/services/item/common/models/producer.json new file mode 100644 index 000000000..f4628b988 --- /dev/null +++ b/services/item/common/models/producer.json @@ -0,0 +1,20 @@ +{ + "name": "Producer", + "base": "VnModel", + "options": { + "mysql": { + "table": "producer", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "String" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/tax-class.json b/services/item/common/models/tax-class.json new file mode 100644 index 000000000..c107f3391 --- /dev/null +++ b/services/item/common/models/tax-class.json @@ -0,0 +1,23 @@ +{ + "name": "TaxClass", + "base": "VnModel", + "options": { + "mysql": { + "table": "taxClass", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "description": { + "type": "String" + }, + "code": { + "type": "String" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/tax-code.json b/services/item/common/models/tax-code.json new file mode 100644 index 000000000..93a426a07 --- /dev/null +++ b/services/item/common/models/tax-code.json @@ -0,0 +1,47 @@ +{ + "name": "TaxCode", + "base": "VnModel", + "options": { + "mysql": { + "table": "taxCode", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "dated": { + "type": "date" + }, + "code": { + "type": "String" + }, + "rate": { + "type": "number" + }, + "equalizationTax": { + "type": "number" + }, + "type": { + "type": "String" + }, + "isActive": { + "type": "Boolean" + } + }, + "relations": { + "taxType": { + "type": "belongsTo", + "model": "TaxType", + "foreignKey": "taxTypeFk" + }, + "link": { + "type": "belongsTo", + "model": "Link", + "foreignKey": "linkFk" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/tax-type.json b/services/item/common/models/tax-type.json new file mode 100644 index 000000000..527e90f39 --- /dev/null +++ b/services/item/common/models/tax-type.json @@ -0,0 +1,36 @@ +{ + "name": "TaxType", + "base": "VnModel", + "options": { + "mysql": { + "table": "taxType", + "database": "vn" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "nickname": { + "type": "String" + }, + "serial": { + "type": "String" + }, + "TIPOOPE": { + "type": "String" + }, + "description": { + "type": "String" + } + }, + "relations": { + "country": { + "type": "belongsTo", + "model": "Country", + "foreignKey": "countryFk" + } + } +} \ No newline at end of file diff --git a/services/item/server/model-config.json b/services/item/server/model-config.json index ab9410fb5..43c9a80fe 100644 --- a/services/item/server/model-config.json +++ b/services/item/server/model-config.json @@ -29,5 +29,29 @@ }, "ItemType": { "dataSource": "vn" + }, + "Ink": { + "dataSource": "vn" + }, + "Origin": { + "dataSource": "vn" + }, + "Producer": { + "dataSource": "vn" + }, + "Intrastat": { + "dataSource": "vn" + }, + "TaxClass": { + "dataSource": "vn" + }, + "TaxCode": { + "dataSource": "vn" + }, + "TaxType": { + "dataSource": "vn" + }, + "Country": { + "dataSource": "salix" } }