-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_config_2.json
187 lines (187 loc) · 7.32 KB
/
db_config_2.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"database_name": "facturacion.db",
"tables": [
{
"name": "Clientes",
"fields": [
{ "name": "ClienteID", "type": "INTEGER", "primary_key": true },
{ "name": "Nombre", "type": "VARCHAR(100)" },
{ "name": "Apellido", "type": "VARCHAR(100)" },
{ "name": "Email", "type": "VARCHAR(100)" },
{ "name": "Telefono", "type": "VARCHAR(20)" },
{ "name": "Direccion", "type": "VARCHAR(200)" },
{ "name": "FechaRegistro", "type": "DATE" }
]
},
{
"name": "CategoriasProductos",
"fields": [
{ "name": "CategoriaID", "type": "INTEGER", "primary_key": true },
{ "name": "NombreCategoria", "type": "VARCHAR(50)" },
{ "name": "Descripcion", "type": "VARCHAR(200)" }
]
},
{
"name": "Productos",
"fields": [
{ "name": "ProductoID", "type": "INTEGER", "primary_key": true },
{ "name": "CategoriaID", "type": "INTEGER" },
{ "name": "NombreProducto", "type": "VARCHAR(100)" },
{ "name": "Descripcion", "type": "VARCHAR(200)" },
{ "name": "PrecioUnitario", "type": "DECIMAL(10, 2)" },
{ "name": "Stock", "type": "INTEGER" }
],
"foreign_keys": [{ "fields": ["CategoriaID"], "references": { "table": "CategoriasProductos", "fields": ["CategoriaID"]} }]
},
{
"name": "Facturas",
"fields": [
{ "name": "FacturaID", "type": "INTEGER", "primary_key": true },
{ "name": "ClienteID", "type": "INTEGER" },
{ "name": "FechaEmision", "type": "DATE" },
{ "name": "FechaVencimiento", "type": "DATE" },
{ "name": "TotalFactura", "type": "DECIMAL(10, 2)" },
{ "name": "EstadoPago", "type": "VARCHAR(20)" }
],
"foreign_keys": [{ "fields": ["ClienteID"], "references": { "table": "Clientes", "fields": ["ClienteID"] } }]
},
{
"name": "DetallesFactura",
"fields": [
{ "name": "DetalleID", "type": "INTEGER", "primary_key": true },
{ "name": "FacturaID", "type": "INTEGER" },
{ "name": "ProductoID", "type": "INTEGER" },
{ "name": "Cantidad", "type": "INTEGER" },
{ "name": "PrecioUnitario", "type": "DECIMAL(10, 2)" },
{ "name": "Subtotal", "type": "DECIMAL(10, 2)" }
],
"foreign_keys": [
{ "fields": ["FacturaID"], "references": { "table": "Facturas", "fields": ["FacturaID"] } },
{ "fields": ["ProductoID"], "references": { "table": "Productos", "fields": ["ProductoID"] } }
]
},
{
"name": "Pagos",
"fields": [
{ "name": "PagoID", "type": "INTEGER", "primary_key": true },
{ "name": "FacturaID", "type": "INTEGER" },
{ "name": "FechaPago", "type": "DATE" },
{ "name": "MontoPagado", "type": "DECIMAL(10, 2)" },
{ "name": "MetodoPago", "type": "VARCHAR(50)" }
],
"foreign_keys": [{"fields": ["FacturaID"], "references": { "table": "Facturas", "fields": ["FacturaID"]}}]
},
{
"name": "MetodosPago",
"fields": [
{ "name": "MetodoPagoID", "type": "INTEGER", "primary_key": true },
{ "name": "NombreMetodo", "type": "VARCHAR(50)" },
{ "name": "Descripcion", "type": "VARCHAR(100)" }
]
},
{
"name": "Consumos",
"fields": [
{ "name": "ConsumoID", "type": "INTEGER", "primary_key": true },
{ "name": "ClienteID", "type": "INTEGER" },
{ "name": "ProductoID", "type": "INTEGER" },
{ "name": "FechaConsumo", "type": "DATE" },
{ "name": "CantidadConsumida", "type": "DECIMAL(10, 2)" }
],
"foreign_keys": [
{"fields": ["ClienteID"], "references": {"table": "Clientes", "fields": ["ClienteID"]}},
{"fields": ["ProductoID"], "references": {"table": "Productos", "fields": ["ProductoID"]}}
]
},
{
"name": "Proveedores",
"fields": [
{ "name": "ProveedorID", "type": "INTEGER", "primary_key": true },
{ "name": "NombreProveedor", "type": "VARCHAR(100)" },
{ "name": "ContactoNombre", "type": "VARCHAR(100)" },
{ "name": "ContactoEmail", "type": "VARCHAR(100)" },
{ "name": "ContactoTelefono", "type": "VARCHAR(20)" }
]
},
{
"name": "ComprasProveedores",
"fields": [
{ "name": "CompraID", "type": "INTEGER", "primary_key": true },
{ "name": "ProveedorID", "type": "INTEGER" },
{ "name": "FechaCompra", "type": "DATE" },
{ "name": "TotalCompra", "type": "DECIMAL(10, 2)" }
],
"foreign_keys": [{"fields": ["ProveedorID"], "references": {"table": "Proveedores", "fields": ["ProveedorID"]}}]
},
{
"name": "DetallesCompraProveedores",
"fields": [
{"name": "DetalleCompraID", "type": "INTEGER", "primary_key": true},
{"name": "CompraID", "type": "INTEGER"},
{"name": "ProductoID", "type": "INTEGER"},
{"name": "Cantidad", "type": "INTEGER"},
{"name": "PrecioUnitario", "type": "DECIMAL(10, 2)"},
{"name": "Subtotal", "type": "DECIMAL(10, 2)"}
],
"foreign_keys": [
{"fields": ["CompraID"], "references": {"table": "ComprasProveedores", "fields": ["CompraID"]}},
{"fields": ["ProductoID"], "references": {"table": "Productos", "fields": ["ProductoID"]}}
]
},
{
"name": "Devoluciones",
"fields": [
{"name": "DevolucionID", "type": "INTEGER", "primary_key": true},
{"name": "FacturaID", "type": "INTEGER"},
{"name": "FechaDevolucion", "type": "DATE"},
{"name": "MotivoDevolucion", "type": "VARCHAR(200)"}
],
"foreign_keys": [{"fields": ["FacturaID"], "references": {"table": "Facturas", "fields": ["FacturaID"]}}]
},
{
"name": "DetallesDevolucion",
"fields": [
{"name": "DetalleDevolucionID", "type": "INTEGER", "primary_key": true},
{"name": "DevolucionID", "type": "INTEGER"},
{"name": "ProductoID", "type": "INTEGER"},
{"name": "Cantidad", "type": "INTEGER"},
{"name": "PrecioUnitario", "type": "DECIMAL(10, 2)"},
{"name": "Subtotal", "type": "DECIMAL(10, 2)"}
],
"foreign_keys": [
{"fields": ["DevolucionID"], "references": {"table": "Devoluciones", "fields": ["DevolucionID"]}},
{"fields": ["ProductoID"], "references": {"table": "Productos", "fields": ["ProductoID"]}}
]
},
{
"name": "Descuentos",
"fields": [
{"name": "DescuentoID", "type": "INTEGER", "primary_key": true},
{"name": "NombreDescuento", "type": "VARCHAR(100)"},
{"name": "TipoDescuento", "type": "VARCHAR(50)"},
{"name": "ValorDescuento", "type": "DECIMAL(10, 2)"},
{"name": "FechaInicio", "type": "DATE"},
{"name": "FechaFin", "type": "DATE"}
]
},
{
"name": "Impuestos",
"fields": [
{"name": "ImpuestoID", "type": "INTEGER", "primary_key": true},
{"name": "NombreImpuesto", "type": "VARCHAR(50)"},
{"name": "Porcentaje", "type": "DECIMAL(5, 2)"}
]
},
{
"name": "Empleados",
"fields": [
{"name": "EmpleadoID", "type": "INTEGER", "primary_key": true},
{"name": "Nombre", "type": "VARCHAR(100)"},
{"name": "Apellido", "type": "VARCHAR(100)"},
{"name": "Cargo", "type": "VARCHAR(50)"},
{"name": "FechaContratacion", "type": "DATE"},
{"name": "Salario", "type": "DECIMAL(10, 2)"}
]
}
]
}