Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
1cfba20
fix fetchcostsbyid
202745EsquedaDaniel Jan 5, 2024
e8cb054
i have added aditional routes for costs
202745EsquedaDaniel Jan 5, 2024
3e36b7d
project costs model and change value migration
202745EsquedaDaniel Jan 8, 2024
6f4d517
add new tables
202745EsquedaDaniel Jan 9, 2024
d7a19a1
calculate all initial
202745EsquedaDaniel Jan 9, 2024
32abc77
abonos service
202745EsquedaDaniel Jan 9, 2024
b13f01f
abonos schemas
202745EsquedaDaniel Jan 9, 2024
c7b0fab
remaining routes completed
202745EsquedaDaniel Jan 10, 2024
4b6aab8
stored procedure + service
202745EsquedaDaniel Jan 11, 2024
81a532a
new services logic
202745EsquedaDaniel Jan 11, 2024
39c275c
fix services
202745EsquedaDaniel Jan 11, 2024
9569a07
add abonos finished
202745EsquedaDaniel Jan 12, 2024
d1c29e9
other function
202745EsquedaDaniel Jan 12, 2024
ac4b830
new db
202745EsquedaDaniel Jan 12, 2024
3247fe4
server features finished
202745EsquedaDaniel Jan 12, 2024
aaae1fc
migration fixed
202745EsquedaDaniel Jan 12, 2024
b1c48eb
add remaining service
202745EsquedaDaniel Jan 12, 2024
3d4d7ed
hook for remaining
202745EsquedaDaniel Jan 12, 2024
fc49afd
remaining finished
202745EsquedaDaniel Jan 12, 2024
882f147
create project fixed
202745EsquedaDaniel Jan 13, 2024
1af31ff
auth middleware
202745EsquedaDaniel Jan 24, 2024
42ad14e
users models and migration
202745EsquedaDaniel Jan 24, 2024
b06f7ab
added bcrypt and user services and routes
202745EsquedaDaniel Jan 24, 2024
3bd1e70
login with passport
202745EsquedaDaniel Jan 25, 2024
cc02c7c
token sign and verify
202745EsquedaDaniel Jan 25, 2024
61070e3
generate token in service login
202745EsquedaDaniel Jan 25, 2024
106dc77
routes protection
202745EsquedaDaniel Jan 26, 2024
3f2a7c5
control-role
202745EsquedaDaniel Jan 26, 2024
0bc3f19
stats route
202745EsquedaDaniel Jan 31, 2024
222f2c6
functions for stats pt.2
202745EsquedaDaniel Feb 1, 2024
050eb21
hook costo = costo_initial
202745EsquedaDaniel Feb 2, 2024
5acbdd5
auth token test
202745EsquedaDaniel Feb 6, 2024
61eb376
validation for gets test
202745EsquedaDaniel Feb 6, 2024
66ad0cd
lib fix
202745EsquedaDaniel Feb 6, 2024
b372d5f
workers validation jwt
202745EsquedaDaniel Feb 6, 2024
41df871
left jwt
202745EsquedaDaniel Feb 7, 2024
a955843
delete abono sql
202745EsquedaDaniel Feb 7, 2024
18ce4ef
new redeploy
202745EsquedaDaniel Feb 8, 2024
9b30906
deploy adjustment
202745EsquedaDaniel Feb 8, 2024
0506bbb
Delete remaining column from projects table
202745EsquedaDaniel Feb 13, 2024
e70a598
calculate weeks duration backend
202745EsquedaDaniel Feb 13, 2024
9329dc7
nomina finished
202745EsquedaDaniel Feb 15, 2024
172461b
nomina-cost
202745EsquedaDaniel Feb 15, 2024
1885cb5
update project cost after add projectWorker
202745EsquedaDaniel Feb 15, 2024
1c7fbbd
Payments details
202745EsquedaDaniel Feb 19, 2024
9c69cc1
backend semanal costs
202745EsquedaDaniel Feb 20, 2024
fffbe66
Refactor weekly expenses calculation and endpoint***
202745EsquedaDaniel Feb 24, 2024
31bbc16
weekly ingresos
202745EsquedaDaniel Feb 26, 2024
b598cdb
dates for payrolls fixed
202745EsquedaDaniel Feb 28, 2024
f5b13c8
major backend update
202745EsquedaDaniel Feb 29, 2024
28fca74
important db update
202745EsquedaDaniel Feb 29, 2024
dd7eb56
nominas backend
202745EsquedaDaniel Mar 1, 2024
aa88e24
nomina fixed
202745EsquedaDaniel Mar 1, 2024
d7ec530
get prestamos and flujo
202745EsquedaDaniel Mar 1, 2024
6f7a642
deploy config
202745EsquedaDaniel Mar 6, 2024
abea225
deploy changes
202745EsquedaDaniel Mar 8, 2024
4e2d876
ready for payrolls
202745EsquedaDaniel Mar 12, 2024
100231c
nominas
202745EsquedaDaniel Mar 15, 2024
a93652d
nominas finished
202745EsquedaDaniel Mar 23, 2024
e9871bc
pre ws
202745EsquedaDaniel Mar 26, 2024
2e4f098
Remaining, total and aboned socket
202745EsquedaDaniel Mar 27, 2024
b2a31c1
id fixed
202745EsquedaDaniel Mar 27, 2024
6279c0e
hugo database and some sockets config
202745EsquedaDaniel Apr 1, 2024
ef6d907
merge
202745EsquedaDaniel Apr 1, 2024
7668804
Nominas adjustemnt
202745EsquedaDaniel Apr 3, 2024
2c01b12
utx adjustment
202745EsquedaDaniel Apr 3, 2024
23449cb
nominas fixed
202745EsquedaDaniel Apr 4, 2024
6c780e2
generate payurolls
202745EsquedaDaniel Apr 5, 2024
4be9bf1
changes
202745EsquedaDaniel Apr 8, 2024
b008c41
adds update salary
HugoLifes Apr 11, 2024
609a534
status update
HugoLifes Apr 11, 2024
3686a9c
debug service
HugoLifes Apr 11, 2024
5aec011
back config
202745EsquedaDaniel Apr 12, 2024
cb072a9
Merge branch 'backend-initial' of https://github.com/00lar/DataFire i…
202745EsquedaDaniel Apr 12, 2024
f80896c
web check
202745EsquedaDaniel Apr 12, 2024
9c5a35a
update salary worker
HugoLifes Apr 12, 2024
d0d39e2
backend changes friday
202745EsquedaDaniel Apr 15, 2024
78a88f2
adjustments logic
202745EsquedaDaniel Apr 15, 2024
86cb262
merge
202745EsquedaDaniel Apr 15, 2024
49db38b
Merge branch 'backend-initial' of https://github.com/00lar/DataFire i…
202745EsquedaDaniel Apr 15, 2024
2612a4f
post adjustment hook
202745EsquedaDaniel Apr 15, 2024
1f8dfaf
sin reinicio
HugoLifes Apr 15, 2024
0b0fff7
last back setting
202745EsquedaDaniel Apr 19, 2024
c30909a
tools archives
202745EsquedaDaniel Apr 19, 2024
be750ff
merge
202745EsquedaDaniel Apr 19, 2024
abe1b90
fix socket
202745EsquedaDaniel Apr 19, 2024
5ebf240
last socket config
202745EsquedaDaniel Apr 19, 2024
b314ec8
last socket config 2
202745EsquedaDaniel Apr 19, 2024
4a451b7
last socket config 3
202745EsquedaDaniel Apr 19, 2024
0bad102
socket config 3
202745EsquedaDaniel Apr 19, 2024
50c53e6
fix socket config
202745EsquedaDaniel Apr 19, 2024
321a421
fix socket config final
202745EsquedaDaniel Apr 19, 2024
85025fb
fix errors
HugoLifes Apr 20, 2024
f474e35
fixin errors 2
HugoLifes Apr 20, 2024
90b2508
error findegresos
HugoLifes Apr 22, 2024
a076f08
ganancias fixed
202745EsquedaDaniel Apr 24, 2024
8d2ab34
jijija
202745EsquedaDaniel Apr 24, 2024
5046769
Merge branch 'finances' into backend-initial
202745EsquedaDaniel Apr 24, 2024
9ea75d2
adjusments socket config
202745EsquedaDaniel Apr 24, 2024
4c76c89
add
HugoLifes Apr 24, 2024
c893237
comentarios
HugoLifes Apr 24, 2024
608f986
restore version
HugoLifes Apr 26, 2024
54efbdb
ajustes
HugoLifes Apr 26, 2024
e2ca057
year worked migration
HugoLifes Apr 26, 2024
dd8702c
new changes
HugoLifes May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/eduar/OneDrive/Escritorio/repositorios/Forks/DataFire/server/services",
"program": "c:/Users/eduar/OneDrive/Escritorio/repositorios/Forks/DataFire/server/services/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
50 changes: 37 additions & 13 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.8.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -204,26 +228,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
mutex:
dependency: transitive
description:
Expand Down Expand Up @@ -268,10 +292,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_provider:
dependency: transitive
description:
Expand Down Expand Up @@ -437,14 +461,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "13.0.0"
win32:
dependency: transitive
description:
Expand All @@ -462,5 +486,5 @@ packages:
source: hosted
version: "1.0.0"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.2.0-0 <4.0.0"
flutter: ">=3.3.0"
6 changes: 4 additions & 2 deletions server/config/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
require("dotenv").config()
require('dotenv').config();

const config = {
env: process.env.NODE_ENV || 'dev',
isProd: process.env.NODE_ENV === "production",
isProd: process.env.NODE_ENV === 'production',
port: process.env.PORT || 3001,
dbUser: process.env.DB_USER,
dbPassword: process.env.DB_PASSWORD,
dbHost: process.env.DB_HOST,
dbName: process.env.DB_NAME,
dbPort: process.env.DB_PORT,
dbUrl: process.env.DATABASE_URL,
apikey: process.env.API_KEY,
jwtsecret: process.env.JWT_SECRET,
};

module.exports = { config };
13 changes: 0 additions & 13 deletions server/db/migrations/20231215215840-add-customerId.js

This file was deleted.

13 changes: 0 additions & 13 deletions server/db/migrations/20231219210347-remove-abono-incorrect.js

This file was deleted.

This file was deleted.

34 changes: 34 additions & 0 deletions server/db/migrations/20240111225052-update-abonos-total.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION actualizar_monto_abonado(nuevo_monto INT, proyecto_id INT) RETURNS VOID AS $$
BEGIN
UPDATE proyectos
SET abonado = abonado + nuevo_monto
WHERE id = proyecto_id;
END;
$$ LANGUAGE plpgsql;
`);

await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION restar_monto_abonado(monto_a_restar INT, proyecto_id INT) RETURNS VOID AS $$
BEGIN
UPDATE proyectos
SET abonado = abonado - monto_a_restar
WHERE id = proyecto_id;
END;
$$ LANGUAGE plpgsql;
`);
},

down: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.query(`
DROP FUNCTION IF EXISTS actualizar_monto_abonado(INT, INT);
`);
await queryInterface.sequelize.query(`
DROP FUNCTION IF EXISTS restar_monto_abonado(INT, INT);
`);
},
};
38 changes: 38 additions & 0 deletions server/db/migrations/20240112081704-services_total.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
// Agrega una función para actualizar el 'costo' en la tabla de proyectos al insertar un nuevo servicio
await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION actualizar_costo_proyecto_al_insertar_servicio(nuevo_costo INT, proyecto_id INT) RETURNS VOID AS $$
BEGIN
UPDATE proyectos
SET costo = costo + nuevo_costo
WHERE id = proyecto_id;
END;
$$ LANGUAGE plpgsql;
`);

// Agrega una función para actualizar el 'costo' en la tabla de proyectos al eliminar un servicio
await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION actualizar_costo_proyecto_al_eliminar_servicio(costo_eliminar INT, proyecto_id INT) RETURNS VOID AS $$
BEGIN
UPDATE proyectos
SET costo = costo - costo_eliminar
WHERE id = proyecto_id;
END;
$$ LANGUAGE plpgsql;
`);
},

down: async (queryInterface, Sequelize) => {
// Elimina las funciones
await queryInterface.sequelize.query(`
DROP FUNCTION IF EXISTS actualizar_costo_proyecto_al_insertar_servicio(INT, INT);
`);

await queryInterface.sequelize.query(`
DROP FUNCTION IF EXISTS actualizar_costo_proyecto_al_eliminar_servicio(INT, INT);
`);
},
};
32 changes: 32 additions & 0 deletions server/db/migrations/20240112222459-calculate_remaining.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION update_remaining()
RETURNS TRIGGER AS $$
BEGIN
NEW.remaining := NEW.costo - NEW.abonado;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
`);

await queryInterface.sequelize.query(`
CREATE TRIGGER before_update_proyectos
BEFORE UPDATE ON proyectos
FOR EACH ROW
EXECUTE FUNCTION update_remaining();
`);
},

down: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.query(`
DROP TRIGGER IF EXISTS before_update_proyectos ON proyectos;
`);

await queryInterface.sequelize.query(`
DROP FUNCTION IF EXISTS update_remaining();
`);
},
};
Loading