├── .env ├── .env.example ├── .gitignore ├── Dockerfile ├── README.md ├── air.toml ├── application ├── application.go └── application_test.go ├── common ├── apperrors │ ├── bad_gateway_error.go │ ├── bad_request_error.go │ ├── conflict_error.go │ ├── forbidden_error.go │ ├── gateway_timeout_error.go │ ├── http_error.go │ ├── insufficient_storage_error.go │ ├── internal_server_error.go │ ├── network_authentication_required_error.go │ ├── not_found_error.go │ ├── not_implemented_error.go │ ├── payment_required_error.go │ ├── service_unavailable_error.go │ ├── too_many_requests_error.go │ ├── unauthorized_error.go │ ├── unavailable_for_legal_reasons_error.go │ └── unprocessable_entity_error.go ├── config │ ├── api_config.go │ ├── app_config.go │ ├── csrf_config.go │ ├── env_config.go │ ├── log_config.go │ └── session_config.go ├── helpers │ ├── csrf_helper.go │ ├── date_info.go │ ├── email_helper.go │ ├── excel_generator.go │ ├── html_pdf_generator.go │ ├── logger.go │ ├── pagination.go │ ├── pagination_param.go │ ├── template_funcs.go │ ├── uploader.go │ └── validator.go └── middlewares │ ├── api_key_middleware.go │ ├── authorization_middleware.go │ ├── core_entity_flag_middleware.go │ ├── cors_middleware.go │ ├── init.go │ ├── jwt_middleware.go │ ├── module_flag_middleware.go │ ├── requests.go │ ├── response.go │ └── session_auth_middleware.go ├── database ├── database.go ├── db_connection.go ├── seed │ ├── create_admin_users.go │ ├── init_database_scripts.go │ └── seed_database.go └── sql │ ├── _structure │ ├── configs-and-extensions.sql │ ├── drop-and.create.sql │ └── schemas.sql │ ├── authentication │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql │ ├── company │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql │ ├── configurations │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql │ ├── employees │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql │ ├── references │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql │ └── reports │ ├── procedures.sql │ ├── queries.sql │ ├── scripts.sql │ ├── tables.sql │ ├── triggers.sql │ └── views.sql ├── docs ├── _diagrams │ ├── .$Golang-Modular-Software.drawio.bkp │ ├── .$Golang-Modular-Software.drawio.dtmp │ ├── App Initalization.png │ ├── Communication by Messaging.png │ ├── Communication.png │ ├── Core Entity Structure.png │ ├── Coupling and Cohesion.png │ ├── Dependency Between Modules.png │ ├── Golang-Modular-Software.drawio │ ├── Modular Architecture.png │ ├── Modular Database.png │ ├── Module Creation.png │ ├── Module Structure.png │ ├── Modules - Flow.png │ ├── Routes.png │ └── Schema-Objects.png ├── authentication │ └── README.md ├── company │ └── README.md ├── configurations │ └── README.md ├── employees │ └── README.md ├── references │ └── README.md └── reports │ └── README.md ├── go.mod ├── go.sum ├── main.go ├── modules ├── authentication │ ├── api │ │ ├── auth_api.go │ │ ├── role_api.go │ │ ├── routes.go │ │ ├── user_api.go │ │ ├── user_api_activation.go │ │ ├── user_api_create_update.go │ │ ├── user_api_get_all.go │ │ └── user_api_get_one.go │ ├── controllers │ │ ├── account_controller.go │ │ ├── auth_controller.go │ │ ├── helper.go │ │ ├── login_activity_controller.go │ │ ├── permission_controller.go │ │ ├── role_controller.go │ │ ├── role_controller_info.go │ │ ├── role_controller_permission.go │ │ ├── root_controller.go │ │ ├── routes.go │ │ ├── user_controller.go │ │ ├── user_controller_activation.go │ │ ├── user_controller_identity.go │ │ ├── user_controller_info.go │ │ ├── user_controller_role.go │ │ └── user_controller_status.go │ ├── entities │ │ ├── auth_request.go │ │ ├── login_activity.go │ │ ├── login_activity_request.go │ │ ├── permission.go │ │ ├── permission_request.go │ │ ├── permission_role.go │ │ ├── role.go │ │ ├── role_info.go │ │ ├── role_request.go │ │ ├── statistics.go │ │ ├── user.go │ │ ├── user_api_key.go │ │ ├── user_association.go │ │ ├── user_request.go │ │ └── user_role.go │ ├── module_routes.go │ ├── repositories │ │ ├── login_activity_repository.go │ │ ├── permission_repository.go │ │ ├── permission_role_repository.go │ │ ├── role_repository.go │ │ ├── statistics_repository.go │ │ ├── user_api_key_repository.go │ │ ├── user_association_repository.go │ │ ├── user_repository.go │ │ └── user_role_repository.go │ └── services │ │ ├── auth_service.go │ │ ├── jwt_service.go │ │ ├── login_activity_service.go │ │ ├── permission_service.go │ │ ├── role_service.go │ │ ├── statistics_service.go │ │ ├── user_service.go │ │ ├── user_service_activation.go │ │ ├── user_service_count.go │ │ ├── user_service_get_all.go │ │ ├── user_service_get_one.go │ │ ├── user_service_identity.go │ │ └── user_service_role.go ├── back_office │ ├── README.md │ ├── controllers │ │ ├── api_root_controller.go │ │ ├── back_office_controller.go │ │ └── routes.go │ └── module_routes.go ├── company │ ├── api │ │ ├── branches_api.go │ │ ├── company_api.go │ │ ├── department_api.go │ │ ├── helper.go │ │ ├── office_api.go │ │ ├── policy_api.go │ │ ├── project_api.go │ │ ├── room_api.go │ │ └── routes.go │ ├── controllers │ │ ├── branch_controller.go │ │ ├── company_controller.go │ │ ├── department_controller.go │ │ ├── helper.go │ │ ├── office_controller.go │ │ ├── policy_controller.go │ │ ├── policy_controller_attachment.go │ │ ├── project_controller.go │ │ ├── project_controller_attachment.go │ │ ├── room_controller.go │ │ ├── root_controller.go │ │ └── routes.go │ ├── entities │ │ ├── branch.go │ │ ├── branch_request.go │ │ ├── company.go │ │ ├── company_request.go │ │ ├── department.go │ │ ├── department_request.go │ │ ├── office.go │ │ ├── office_request.go │ │ ├── policy.go │ │ ├── policy_attachment.go │ │ ├── policy_attachment_request.go │ │ ├── policy_request.go │ │ ├── project.go │ │ ├── project_attachment.go │ │ ├── project_attachment_request.go │ │ ├── project_request.go │ │ ├── room.go │ │ ├── room_request.go │ │ └── statitstics.go │ ├── module_routes.go │ ├── repositories │ │ ├── branch_repository.go │ │ ├── company_repository.go │ │ ├── department_repository.go │ │ ├── office_repository.go │ │ ├── policy_attachment_repository.go │ │ ├── policy_repository.go │ │ ├── project_attachment_repository.go │ │ ├── project_repository.go │ │ ├── room_repository.go │ │ └── statistics_repository.go │ └── services │ │ ├── branch_service.go │ │ ├── company_service.go │ │ ├── department_service.go │ │ ├── office_service.go │ │ ├── policy_attachment_service.go │ │ ├── policy_service.go │ │ ├── project_attachment_service.go │ │ ├── project_service.go │ │ ├── room_service.go │ │ └── statistics_service.go ├── configurations │ ├── api │ │ ├── basic_configuration_api.go │ │ ├── company_configuration_api.go │ │ ├── core_entity_flag_api.go │ │ ├── email_configuration_api.go │ │ ├── helper.go │ │ ├── module_flag_api.go │ │ └── routes.go │ ├── controllers │ │ ├── basic_configuration_controller.go │ │ ├── company_configuration_controller.go │ │ ├── core_entity_controller.go │ │ ├── core_entity_flag_controller.go │ │ ├── email_configuration_controller.go │ │ ├── helper.go │ │ ├── module_flag_controller.go │ │ ├── root_controller.go │ │ └── routes.go │ ├── entities │ │ ├── app_configuration.go │ │ ├── basic_configuration.go │ │ ├── basic_configuration_request.go │ │ ├── company_configuration.go │ │ ├── company_configuration_request.go │ │ ├── core_entity.go │ │ ├── core_entity_flag.go │ │ ├── core_entity_flag_request.go │ │ ├── core_entity_flag_status.go │ │ ├── core_entity_info.go │ │ ├── core_entity_request.go │ │ ├── email_configuration.go │ │ ├── email_configuration_request.go │ │ ├── module.go │ │ ├── module_flag.go │ │ ├── module_flag_request.go │ │ ├── module_flag_status.go │ │ ├── module_info.go │ │ └── module_request.go │ ├── module_routes.go │ ├── repositories │ │ ├── basic_configuration_repository.go │ │ ├── company_configuration_repository.go │ │ ├── core_entity_flag_repository.go │ │ ├── core_entity_repository.go │ │ ├── db_monitor.go │ │ ├── email_configuration_repository.go │ │ ├── module_flag_repository.go │ │ └── module_repository.go │ └── services │ │ ├── app_config_service.go │ │ ├── basic_configuration_service.go │ │ ├── company_configuration_service.go │ │ ├── core_entity_flag_service.go │ │ ├── core_entity_flag_status_service.go │ │ ├── core_entity_service.go │ │ ├── email_configuration_service.go │ │ ├── module_flag_service.go │ │ ├── module_flag_status_service.go │ │ └── module_service.go ├── employees │ ├── api │ │ ├── employee_api.go │ │ ├── employee_api_account.go │ │ ├── employee_api_address.go │ │ ├── employee_api_contacts.go │ │ ├── employee_api_documents.go │ │ ├── employee_api_info.go │ │ ├── employee_api_professional.go │ │ ├── helper.go │ │ └── routes.go │ ├── controllers │ │ ├── document_type_controller.go │ │ ├── employee_account_controller.go │ │ ├── employee_controller.go │ │ ├── employee_controller_address.go │ │ ├── employee_controller_contacts.go │ │ ├── employee_controller_documents.go │ │ ├── employee_controller_info.go │ │ ├── employee_controller_professional_info.go │ │ ├── helper.go │ │ ├── job_title_controller.go │ │ ├── root_controller.go │ │ └── routes.go │ ├── entities │ │ ├── address.go │ │ ├── address_request.go │ │ ├── document.go │ │ ├── document_request.go │ │ ├── document_type.go │ │ ├── document_type_request.go │ │ ├── employee.go │ │ ├── employee_account.go │ │ ├── employee_complete_data.go │ │ ├── employee_email.go │ │ ├── employee_email_request.go │ │ ├── employee_phone.go │ │ ├── employee_phone_request.go │ │ ├── employee_request.go │ │ ├── job_title.go │ │ ├── job_title_request.go │ │ ├── professional_info.go │ │ ├── professional_info_request.go │ │ └── statistics.go │ ├── module_routes.go │ ├── repositories │ │ ├── address_repository.go │ │ ├── document_repository.go │ │ ├── document_type_repository.go │ │ ├── employee_account_repository.go │ │ ├── employee_complete_data_repository.go │ │ ├── employee_email_repository.go │ │ ├── employee_phone_repository.go │ │ ├── employee_repository.go │ │ ├── job_title_repository.go │ │ ├── professional_info_repository.go │ │ └── statistics_repository.go │ └── services │ │ ├── address_service.go │ │ ├── document_service.go │ │ ├── document_type_service.go │ │ ├── employee_account_service.go │ │ ├── employee_complete_data_service.go │ │ ├── employee_email_service.go │ │ ├── employee_phone_service.go │ │ ├── employee_service.go │ │ ├── employee_service_get_one.go │ │ ├── job_title_service.go │ │ ├── professional_info_service.go │ │ └── statistics_service.go ├── references │ ├── api │ │ ├── approval_status_api.go │ │ ├── contact_type_api.go │ │ ├── country_api.go │ │ ├── currency_api.go │ │ ├── document_status_api.go │ │ ├── employment_status_api.go │ │ ├── helper.go │ │ ├── identification_type_api.go │ │ ├── marital_status_api.go │ │ ├── routes.go │ │ ├── task_status_api.go │ │ └── workflow_status_api.go │ ├── controllers │ │ ├── approval_status_controller.go │ │ ├── contact_type_controller.go │ │ ├── country_controller.go │ │ ├── currency_controller.go │ │ ├── document_status_controller.go │ │ ├── employment_status_controller.go │ │ ├── evaluation_status_controller.go │ │ ├── helper.go │ │ ├── identifaction_type_controller.go │ │ ├── marital_status_controller.go │ │ ├── root_controller.go │ │ ├── routes.go │ │ ├── task_status_controller.go │ │ ├── user_status_controller.go │ │ └── workflow_status_controller.go │ ├── entities │ │ ├── approval_status.go │ │ ├── contact_type.go │ │ ├── country.go │ │ ├── country_request.go │ │ ├── currency.go │ │ ├── currency_request.go │ │ ├── document_status.go │ │ ├── employment_status.go │ │ ├── evaluation_status.go │ │ ├── identification_type.go │ │ ├── marital_status.go │ │ ├── statistics.go │ │ ├── status_request.go │ │ ├── task_status.go │ │ ├── type_request.go │ │ ├── user_status.go │ │ └── workflow_status.go │ ├── module_routes.go │ ├── repositories │ │ ├── approval_status_repository.go │ │ ├── contact_type_repository.go │ │ ├── country_repository.go │ │ ├── currency_repository.go │ │ ├── document_status_repository.go │ │ ├── employment_status_repository.go │ │ ├── evaluation_status_repository.go │ │ ├── identification_type_repository.go │ │ ├── marital_status_repository.go │ │ ├── statistics_repository.go │ │ ├── task_status_repository.go │ │ ├── user_status_repository.go │ │ └── workflow_status_repository.go │ └── services │ │ ├── approval_status_service.go │ │ ├── contact_type_service.go │ │ ├── country_service.go │ │ ├── currency_service.go │ │ ├── document_status_service.go │ │ ├── employment_status_service.go │ │ ├── evaluation_status_service.go │ │ ├── identification_type_service.go │ │ ├── marital_status_service.go │ │ ├── statistics_service.go │ │ ├── task_status_service.go │ │ ├── user_status_service.go │ │ └── workflow_status_service.go ├── register_routes.go ├── reports │ ├── api │ │ └── routes.go │ ├── controllers │ │ ├── company_report_controller.go │ │ ├── configuration_report_controller.go │ │ ├── employee_report_controller.go │ │ ├── helper.go │ │ ├── root_controller.go │ │ ├── routes.go │ │ └── user_report_controller.go │ └── module_routes.go └── shared │ ├── controllers │ ├── base_controller.go │ └── controller.go │ ├── entities │ ├── base_entity.go │ └── entity.go │ └── repositories │ ├── base_repository.go │ ├── base_repository_aux.go │ ├── base_repository_batch.go │ ├── base_repository_count.go │ ├── base_repository_deletion.go │ ├── base_repository_exists.go │ ├── base_repository_find_all.go │ ├── base_repository_find_one.go │ ├── base_repository_transaction.go │ └── base_repository_update.go └── public ├── static ├── css │ ├── auth-style.css │ ├── report-style.css │ ├── style.css │ ├── style.css.map │ └── validation-style.css ├── images │ ├── logo.png │ └── user-blank.jpg ├── js │ ├── auth-script.js │ ├── dashboard.js │ └── script.js ├── lib │ ├── jquery-validation │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ ├── jquery │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ └── semantic-ui │ │ ├── .versions │ │ ├── LICENSE │ │ ├── README.md │ │ ├── components │ │ ├── accordion.css │ │ ├── accordion.js │ │ ├── accordion.min.css │ │ ├── accordion.min.js │ │ ├── ad.css │ │ ├── ad.min.css │ │ ├── api.js │ │ ├── api.min.js │ │ ├── breadcrumb.css │ │ ├── breadcrumb.min.css │ │ ├── button.css │ │ ├── button.min.css │ │ ├── card.css │ │ ├── card.min.css │ │ ├── checkbox.css │ │ ├── checkbox.js │ │ ├── checkbox.min.css │ │ ├── checkbox.min.js │ │ ├── colorize.js │ │ ├── colorize.min.js │ │ ├── comment.css │ │ ├── comment.min.css │ │ ├── container.css │ │ ├── container.min.css │ │ ├── dimmer.css │ │ ├── dimmer.js │ │ ├── dimmer.min.css │ │ ├── dimmer.min.js │ │ ├── divider.css │ │ ├── divider.min.css │ │ ├── dropdown.css │ │ ├── dropdown.js │ │ ├── dropdown.min.css │ │ ├── dropdown.min.js │ │ ├── embed.css │ │ ├── embed.js │ │ ├── embed.min.css │ │ ├── embed.min.js │ │ ├── feed.css │ │ ├── feed.min.css │ │ ├── flag.css │ │ ├── flag.min.css │ │ ├── form.css │ │ ├── form.js │ │ ├── form.min.css │ │ ├── form.min.js │ │ ├── grid.css │ │ ├── grid.min.css │ │ ├── header.css │ │ ├── header.min.css │ │ ├── icon.css │ │ ├── icon.min.css │ │ ├── image.css │ │ ├── image.min.css │ │ ├── input.css │ │ ├── input.min.css │ │ ├── item.css │ │ ├── item.min.css │ │ ├── label.css │ │ ├── label.min.css │ │ ├── list.css │ │ ├── list.min.css │ │ ├── loader.css │ │ ├── loader.min.css │ │ ├── menu.css │ │ ├── menu.min.css │ │ ├── message.css │ │ ├── message.min.css │ │ ├── modal.css │ │ ├── modal.js │ │ ├── modal.min.css │ │ ├── modal.min.js │ │ ├── nag.css │ │ ├── nag.js │ │ ├── nag.min.css │ │ ├── nag.min.js │ │ ├── placeholder.css │ │ ├── placeholder.min.css │ │ ├── popup.css │ │ ├── popup.js │ │ ├── popup.min.css │ │ ├── popup.min.js │ │ ├── progress.css │ │ ├── progress.js │ │ ├── progress.min.css │ │ ├── progress.min.js │ │ ├── rail.css │ │ ├── rail.min.css │ │ ├── rating.css │ │ ├── rating.js │ │ ├── rating.min.css │ │ ├── rating.min.js │ │ ├── reset.css │ │ ├── reset.min.css │ │ ├── reveal.css │ │ ├── reveal.min.css │ │ ├── search.css │ │ ├── search.js │ │ ├── search.min.css │ │ ├── search.min.js │ │ ├── segment.css │ │ ├── segment.min.css │ │ ├── shape.css │ │ ├── shape.js │ │ ├── shape.min.css │ │ ├── shape.min.js │ │ ├── sidebar.css │ │ ├── sidebar.js │ │ ├── sidebar.min.css │ │ ├── sidebar.min.js │ │ ├── site.css │ │ ├── site.js │ │ ├── site.min.css │ │ ├── site.min.js │ │ ├── state.js │ │ ├── state.min.js │ │ ├── statistic.css │ │ ├── statistic.min.css │ │ ├── step.css │ │ ├── step.min.css │ │ ├── sticky.css │ │ ├── sticky.js │ │ ├── sticky.min.css │ │ ├── sticky.min.js │ │ ├── tab.css │ │ ├── tab.js │ │ ├── tab.min.css │ │ ├── tab.min.js │ │ ├── table.css │ │ ├── table.min.css │ │ ├── transition.css │ │ ├── transition.js │ │ ├── transition.min.css │ │ ├── transition.min.js │ │ ├── video.css │ │ ├── video.js │ │ ├── video.min.css │ │ ├── video.min.js │ │ ├── visibility.js │ │ ├── visibility.min.js │ │ ├── visit.js │ │ └── visit.min.js │ │ ├── package.js │ │ ├── semantic.css │ │ ├── semantic.js │ │ ├── semantic.min.css │ │ ├── semantic.min.js │ │ └── themes │ │ └── default │ │ └── assets │ │ ├── fonts │ │ ├── brand-icons.eot │ │ ├── brand-icons.svg │ │ ├── brand-icons.ttf │ │ ├── brand-icons.woff │ │ ├── brand-icons.woff2 │ │ ├── icons.eot │ │ ├── icons.otf │ │ ├── icons.svg │ │ ├── icons.ttf │ │ ├── icons.woff │ │ ├── icons.woff2 │ │ ├── outline-icons.eot │ │ ├── outline-icons.svg │ │ ├── outline-icons.ttf │ │ ├── outline-icons.woff │ │ └── outline-icons.woff2 │ │ └── images │ │ └── flags.png └── scss │ └── style.scss ├── templates ├── _back_office │ ├── api-root.html │ ├── home.html │ └── notifications.html ├── _errors │ ├── authentication.html │ ├── authorization.html │ └── error.html ├── _partials │ ├── footer-auth.html │ ├── footer-back.html │ ├── header-auth.html │ ├── header-back.html │ └── menu.html ├── authentication │ ├── _root │ │ └── index.html │ ├── account │ │ ├── change-data.html │ │ ├── change-password.html │ │ ├── upload-image.html │ │ └── user-data.html │ ├── auth │ │ ├── get-recover-link.html │ │ ├── login.html │ │ └── recover-password.html │ ├── login-activity │ │ ├── details.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── permission │ │ ├── create.html │ │ ├── delete.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── role │ │ ├── assign-permission.html │ │ ├── create.html │ │ ├── delete.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── remove-permission.html │ │ ├── search-results.html │ │ └── search.html │ └── user │ │ ├── activate.html │ │ ├── active-users.html │ │ ├── assign-role.html │ │ ├── create.html │ │ ├── deactivate.html │ │ ├── details-api-info.html │ │ ├── details-roles.html │ │ ├── details-status-activity.html │ │ ├── details-user-info.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── inactive-users.html │ │ ├── index.html │ │ ├── offline-users.html │ │ ├── online-users.html │ │ ├── remove-role.html │ │ ├── reset-password.html │ │ ├── search-results.html │ │ └── search.html ├── company │ ├── _root │ │ └── index.html │ ├── branch │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── company-info │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ └── index.html │ ├── department │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── office │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── policy │ │ ├── add-attachment.html │ │ ├── create.html │ │ ├── delete-attachment.html │ │ ├── delete.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── project │ │ ├── add-attachment.html │ │ ├── create.html │ │ ├── delete-attachment.html │ │ ├── delete.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ └── room │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html ├── configuration │ ├── _root │ │ └── index.html │ ├── basic │ │ ├── edit.html │ │ └── index.html │ ├── company │ │ ├── edit.html │ │ └── index.html │ ├── core-entity-flag │ │ ├── index.html │ │ └── manage.html │ ├── core-entity │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── email │ │ ├── edit.html │ │ └── index.html │ └── module-flag │ │ ├── index.html │ │ └── manage.html ├── employee │ ├── _root │ │ └── index.html │ ├── document-type │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── employee-info │ │ ├── add-address.html │ │ ├── add-document.html │ │ ├── add-email.html │ │ ├── add-phone.html │ │ ├── add-professional-info.html │ │ ├── add-user-account.html │ │ ├── associate-user-account.html │ │ ├── create.html │ │ ├── details-address.html │ │ ├── details-contacts.html │ │ ├── details-documents.html │ │ ├── details-health.html │ │ ├── details-personal.html │ │ ├── details-professional.html │ │ ├── details-user-account.html │ │ ├── details.html │ │ ├── edit-address.html │ │ ├── edit-document.html │ │ ├── edit-email.html │ │ ├── edit-phone.html │ │ ├── edit-professional-info.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ └── job-title │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html ├── reference │ ├── _root │ │ └── index.html │ ├── approval-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── contact-type │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── country │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── currency │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── document-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── employment-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── evaluation-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── identification-type │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── marital-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── task-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ ├── user-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html │ └── workflow-status │ │ ├── create.html │ │ ├── details.html │ │ ├── edit.html │ │ ├── index.html │ │ ├── search-results.html │ │ └── search.html └── reports │ ├── _root │ └── index.html │ ├── company │ └── index.html │ ├── configuration │ └── index.html │ ├── employee │ └── index.html │ └── user │ └── index.html └── uploads └── images └── users ├── 0a24cec6-bc8b-4cdd-9af8-2eb41c168045.jpeg ├── 14ccf714-cb8a-44db-9d49-f8b1b69cd0dc.jpg ├── 362bc6af-dd97-44f3-bc7d-e8c5c22d1129.jpg ├── 3a563b32-d269-45ba-8031-653195922c0b.jpg ├── 7a0588fa-d015-46d0-ae8b-75c9904c44a0.jpg ├── 9cb5dcaf-0c9f-4726-9b10-304f9262d378.jpg └── a77f98b3-d0d4-4312-b71a-cde1ca2f8c98.jpg /.env: -------------------------------------------------------------------------------- 1 | # Environment 2 | ENV=developement 3 | 4 | # Application settings 5 | APP_HOST=0.0.0.0 6 | APP_PORT=4003 7 | APP_SESSION_EXPIRATION=10 # Minutes 8 | APP_SHUTDOWN_TIMEOUT=5 9 | 10 | # Database settings 11 | DATABASE_MAIN_URL=postgres://postgres:003334743LA032@localhost:5432/golang_modular_software?sslmode=disable 12 | DATABASE_REPORT_URL=postgres://postgres:003334743LA032@localhost:5432/golang_modular_software_reports?sslmode=disable 13 | DATABASE_SEEDING_STATUS=true 14 | 15 | # File Paths 16 | UPLOAD_IMAGE_PATH=./public/uploads/images 17 | UPLOAD_DOCUMENT_PATH=./public/uploads/documents 18 | 19 | # Upload Sizes in MB 20 | MAX_UPLOAD_IMAGE_SIZE=5 21 | MAX_UPLOAD_DOCUMENT_SIZE=5 22 | 23 | # Requests 24 | REQUESTS_PER_SECONDS=5 25 | REQUESTS_EXPIRATION=10 26 | 27 | # CSRF 28 | CSRF_EXPIRATION=24 # CSRF token expiration in hours 29 | CSRF_COOKIE_SECURE=true # Whether the CSRF cookie should be secure 30 | 31 | 32 | # Logging settings 33 | LOG_ROOT_PATH=./logs 34 | LOG_MAX_SIZE=100 # MB 35 | LOG_MAX_AGE=24 #Days 36 | LOG_MAX_BACKUPS=3 37 | 38 | # JWT settings 39 | JWT_SECRET_KEY=d8F3h@2K!pR7qL$9vN4uYz0xWqBm&7nH 40 | JWT_EXPIRATION=2 # hours 41 | 42 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Environment 2 | ENV=development 3 | 4 | # Application settings 5 | APP_HOST=0.0.0.0 6 | APP_PORT=4003 7 | APP_SESSION_EXPIRATION=10 # Minutes 8 | APP_SHUTDOWN_TIMEOUT=5 # Seconds 9 | 10 | # Database settings 11 | DATABASE_MAIN_URL=postgres://username:password@localhost:5432/?sslmode=disable 12 | DATABASE_REPORT_URL=postgres://username:password@localhost:5432/?sslmode=disable 13 | DATABASE_SEEDING_STATUS=true 14 | 15 | # File Paths 16 | UPLOAD_IMAGE_PATH=./public/uploads/images 17 | UPLOAD_DOCUMENT_PATH=./public/uploads/documents 18 | 19 | # Upload Sizes in MB 20 | MAX_UPLOAD_IMAGE_SIZE=5 21 | MAX_UPLOAD_DOCUMENT_SIZE=5 22 | 23 | # Requests 24 | REQUESTS_PER_SECONDS=5 25 | REQUESTS_EXPIRATION=10 # Minutes 26 | 27 | # CSRF 28 | CSRF_EXPIRATION=24 # CSRF token expiration in hours 29 | CSRF_COOKIE_SECURE=true # Whether the CSRF cookie should be secure 30 | 31 | # Logging settings 32 | LOG_ROOT_PATH=./logs 33 | LOG_MAX_SIZE=100 # MB 34 | LOG_MAX_AGE=24 # Days 35 | LOG_MAX_BACKUPS=3 36 | 37 | # JWT settings 38 | JWT_SECRET_KEY=your_jwt_secret_key_here 39 | JWT_EXPIRED_IN=2 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Log files 2 | *.log 3 | 4 | # Environment variables 5 | .env 6 | 7 | # JSON files 8 | *.json 9 | 10 | # Uploaded files 11 | public/uploads/ 12 | 13 | # IDE/Editor-specific files 14 | .vscode/ 15 | 16 | # Compiled output (Golang, etc.) 17 | *.out 18 | *.exe -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine as builder 2 | WORKDIR /app 3 | COPY go.mod . 4 | COPY go.sum . 5 | RUN go mod download 6 | COPY . . 7 | RUN GOOS=linux go build -o golang-modular-software 8 | 9 | 10 | FROM alpine 11 | WORKDIR /app 12 | COPY --from=builder /app /app/ 13 | EXPOSE 4003 14 | CMD [ "./golang-modular-software" ] -------------------------------------------------------------------------------- /air.toml: -------------------------------------------------------------------------------- 1 | # .air.toml 2 | 3 | # Application name 4 | app = "golang-modular-software" 5 | 6 | # Directory to watch for changes 7 | root = "." 8 | 9 | # Output directory for built artifacts 10 | build = "build" 11 | 12 | # Path to the main Go file 13 | cmd = "main.go" 14 | 15 | # Reload configuration 16 | [watch] 17 | # Files to watch for changes (including HTML templates) 18 | include = ["*.go", "public/templates/**/*"] 19 | 20 | # Files to ignore 21 | exclude = ["build/**/*"] 22 | 23 | # Commands to execute before building 24 | [build] 25 | cmd = "go build -o ./build/main main.go" 26 | 27 | # Commands to execute after building 28 | [run] 29 | cmd = "./build/main" 30 | -------------------------------------------------------------------------------- /application/application_test.go: -------------------------------------------------------------------------------- 1 | package application 2 | -------------------------------------------------------------------------------- /common/apperrors/bad_gateway_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func BadGatewayError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusBadGateway, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/bad_request_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func BadRequestError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusBadRequest, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/conflict_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ConflictError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusConflict, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/forbidden_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ForbiddenError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusForbidden, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/gateway_timeout_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func GatewayTimeoutError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusGatewayTimeout, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/http_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | type HttpError struct { 4 | Message string 5 | StatusCode int 6 | } 7 | 8 | func (err *HttpError) Error() string { 9 | return err.Message 10 | } -------------------------------------------------------------------------------- /common/apperrors/insufficient_storage_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func InsufficientStorageError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusInsufficientStorage, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/internal_server_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import "net/http" 4 | 5 | func InternalServerError(message string) *HttpError { 6 | return &HttpError{ 7 | Message: message, 8 | StatusCode: http.StatusInternalServerError, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /common/apperrors/network_authentication_required_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func NetworkAuthenticationRequiredError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusNetworkAuthenticationRequired, 11 | } 12 | } -------------------------------------------------------------------------------- /common/apperrors/not_found_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func NotFoundError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusNotFound, 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /common/apperrors/not_implemented_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func NotImplementedError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusNotImplemented, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/payment_required_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func PaymentRequiredError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusPaymentRequired, 11 | } 12 | } -------------------------------------------------------------------------------- /common/apperrors/service_unavailable_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ServiceUnavailableError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusServiceUnavailable, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/too_many_requests_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TooManyRequestsError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusTooManyRequests, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/unauthorized_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func UnauthorizedError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusUnauthorized, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/apperrors/unavailable_for_legal_reasons_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func UnavailableForLegalReasonsError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusUnavailableForLegalReasons, 11 | } 12 | } -------------------------------------------------------------------------------- /common/apperrors/unprocessable_entity_error.go: -------------------------------------------------------------------------------- 1 | package apperrors 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func UnprocessableEntityError(message string) *HttpError { 8 | return &HttpError{ 9 | Message: message, 10 | StatusCode: http.StatusUnprocessableEntity, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/config/api_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/ortizdavid/go-nopain/conversion" 4 | 5 | 6 | // ---- JWT 7 | func JwtSecretKey() string { 8 | return GetEnv("JWT_SECRET_KEY") 9 | } 10 | 11 | func JwtExpiration() int { 12 | return conversion.StringToInt(GetEnv("JWT_EXPIRATION")) 13 | } 14 | 15 | // ---- Requests 16 | func RequestsPerSecond() int { 17 | return conversion.StringToInt(GetEnv("REQUESTS_PER_SECONDS")) 18 | } 19 | 20 | func RequestsExpiration() int { 21 | return conversion.StringToInt(GetEnv("REQUESTS_EXPIRATION")) 22 | } 23 | 24 | -------------------------------------------------------------------------------- /common/config/app_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/gofiber/template/html/v2" 6 | "github.com/ortizdavid/go-nopain/conversion" 7 | ) 8 | 9 | func ConfigStaticFiles(app *fiber.App) { 10 | app.Static("/", "./public/static") 11 | app.Static("/uploads", "./public/uploads") 12 | } 13 | 14 | func GetTemplateEngine() *html.Engine { 15 | engine := html.New("./public/templates", ".html") 16 | return engine 17 | } 18 | 19 | func ListenAddr() string { 20 | return AppHost() +":"+ AppPort() 21 | } 22 | 23 | func AppHost() string { 24 | return GetEnv("APP_HOST") 25 | } 26 | 27 | func AppPort() string { 28 | return GetEnv("APP_PORT") 29 | } 30 | 31 | func ShutdownTimeout() int { 32 | return conversion.StringToInt(GetEnv("SHUTDOWN_TIMEOUT")) 33 | } 34 | 35 | //------- Uploads 36 | func UploadImagePath() string { 37 | return GetEnv("UPLOAD_IMAGE_PATH") 38 | } 39 | 40 | func UploadDocumentPath() string { 41 | return GetEnv("UPLOAD_DOCUMENT_PATH") 42 | } 43 | 44 | func MaxUploadImageSize() int { 45 | return conversion.StringToInt(GetEnv("MAX_UPLOAD_IMAGE_SIZE")) 46 | } 47 | 48 | func MaxUploadDocumentSize() int { 49 | return conversion.StringToInt(GetEnv("MAX_UPLOAD_DOCUMENT_SIZE")) 50 | } 51 | -------------------------------------------------------------------------------- /common/config/csrf_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "strconv" 5 | "github.com/ortizdavid/go-nopain/conversion" 6 | ) 7 | 8 | func CsrfExpiration() int { 9 | return conversion.StringToInt(GetEnv("CSRF_EXPIRATION")) 10 | } 11 | 12 | func CsrfCookieSecure() bool { 13 | if GetEnv("ENV") == "production" { 14 | return true 15 | } 16 | secure, err := strconv.ParseBool(GetEnv("CSRF_COOKIE_SECURE")) 17 | if err != nil { 18 | return false 19 | } 20 | return secure 21 | } 22 | -------------------------------------------------------------------------------- /common/config/env_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "github.com/joho/godotenv" 7 | ) 8 | 9 | func LoadDotEnv() { 10 | err := godotenv.Load(".env") 11 | if err != nil { 12 | log.Fatal("Error while loading .env file") 13 | } 14 | } 15 | 16 | func GetEnv(key string) string { 17 | LoadDotEnv() 18 | value, exists := os.LookupEnv(key) 19 | if !exists { 20 | log.Fatalf("Environment variable %s not found", key) 21 | } 22 | return value 23 | } -------------------------------------------------------------------------------- /common/config/session_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "time" 5 | "github.com/gofiber/fiber/v2/middleware/session" 6 | "github.com/gofiber/storage/postgres" 7 | "github.com/ortizdavid/go-nopain/conversion" 8 | ) 9 | 10 | func GetSessionStore() *session.Store { 11 | storage := postgres.New(postgres.Config{ 12 | ConnectionURI: GetEnv("DATABASE_MAIN_URL"), 13 | Reset: false, 14 | GCInterval: time.Duration(SessionExpiration()) * time.Minute, 15 | }) 16 | store := session.New(session.Config{ 17 | Storage: storage, 18 | }) 19 | return store 20 | } 21 | 22 | func SessionExpiration() int { 23 | return conversion.StringToInt(GetEnv("APP_SESSION_EXPIRATION")) 24 | } 25 | -------------------------------------------------------------------------------- /common/helpers/csrf_helper.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/go-nopain/encryption" 6 | "github.com/ortizdavid/golang-modular-software/common/config" 7 | ) 8 | 9 | func GenerateCsrfToken(c *fiber.Ctx) string { 10 | store := config.GetSessionStore() 11 | session, err := store.Get(c) 12 | if err != nil { 13 | return "" 14 | } 15 | csrfToken := encryption.GenerateRandomToken() 16 | session.Set("csrf_token", csrfToken) 17 | session.Save() 18 | return csrfToken 19 | } 20 | 21 | func ValidateCsrfToken(c *fiber.Ctx, requestToken any) bool { 22 | store := config.GetSessionStore() 23 | session, err := store.Get(c) 24 | if err != nil { 25 | return false 26 | } 27 | storedToken := session.Get("csrf_token") 28 | return storedToken == requestToken 29 | } 30 | 31 | func CheckCsrfToken(c *fiber.Ctx, token string) error { 32 | if !ValidateCsrfToken(c, token) { 33 | return c.Status(fiber.StatusForbidden).Render("_errors/error", fiber.Map{ 34 | "Title": "CSRF Error", 35 | "Message": "CSRF token validation failed ", 36 | }) 37 | } 38 | return nil 39 | } 40 | 41 | -------------------------------------------------------------------------------- /common/helpers/date_info.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import "github.com/ortizdavid/go-nopain/datetime" 4 | 5 | type DateInfo struct { 6 | CurrentDate string 7 | CurrentDateTime string 8 | LastDayOfCurrentWeek string 9 | LastDayOfCurrentMonth string 10 | LastDayOfCurrentYear string 11 | EighteenYearsOld string 12 | } 13 | 14 | func GetDateInfo() DateInfo { 15 | return DateInfo{ 16 | CurrentDate: datetime.CurrentDate(), 17 | CurrentDateTime: datetime.CurrentDateTime(), 18 | LastDayOfCurrentWeek: datetime.LastDayOfCurrentWeekStr(), 19 | LastDayOfCurrentMonth: datetime.LastDayOfCurrentMonthStr(), 20 | LastDayOfCurrentYear: datetime.LastDateOfYearStr(), 21 | EighteenYearsOld: datetime.SubtractYearsStr(datetime.CurrentDate(), 18), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/helpers/email_helper.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | func RecoverLinkTmpl(userName string, recoverLink string) string { 4 | return ` 5 | 6 | 7 |

Password Recovery!

8 |

Hello, `+userName+`!

9 |

To recover password Click Here

10 | 11 | ` 12 | } 13 | 14 | func RecoverPasswordTmpl(userName string, password string) string { 15 | return ` 16 | 17 | 18 |

Password Changed!

19 |

Hello, `+userName+`!

20 |

Your new password: `+password+`

21 | 22 | ` 23 | } -------------------------------------------------------------------------------- /common/helpers/pagination_param.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import ( 4 | "errors" 5 | "github.com/gofiber/fiber/v2" 6 | "github.com/ortizdavid/go-nopain/conversion" 7 | ) 8 | 9 | type PaginationParam struct { 10 | CurrentPage int `json:"current_page"` 11 | Limit int `json:"limit"` 12 | } 13 | 14 | func (p *PaginationParam) Validate() error { 15 | if p.CurrentPage < 0 { 16 | return errors.New("current_page must be greater or equal than 0") 17 | } 18 | if p.Limit < 0 { 19 | return errors.New("limit must be greater than 0") 20 | } 21 | return nil 22 | } 23 | 24 | func GetPaginationParams(c *fiber.Ctx) PaginationParam { 25 | currentStr := c.Query("current_page") 26 | limitStr := c.Query("limit") 27 | if currentStr == "" { 28 | currentStr = "0" 29 | } 30 | if limitStr == "" { 31 | limitStr = "10" 32 | } 33 | currentPage := conversion.StringToInt(currentStr) 34 | limit := conversion.StringToInt(limitStr) 35 | return PaginationParam{ 36 | CurrentPage: currentPage, 37 | Limit: limit, 38 | } 39 | } -------------------------------------------------------------------------------- /common/helpers/template_funcs.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import "github.com/gofiber/template/html/v2" 4 | 5 | func AddTemplateHelpers(engine *html.Engine) { 6 | //engine.AddFunc("Func1", Func1) 7 | } -------------------------------------------------------------------------------- /common/middlewares/init.go: -------------------------------------------------------------------------------- 1 | package middlewares 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func InitializeMiddlewares(router *fiber.App, db *database.Database) { 9 | router.Use(NewRequestLoggerMiddleware().Handle) 10 | router.Use(NewCorsMiddleware().Handle) 11 | } -------------------------------------------------------------------------------- /common/middlewares/module_flag_middleware.go: -------------------------------------------------------------------------------- 1 | package middlewares 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | "github.com/ortizdavid/golang-modular-software/modules/configurations/services" 7 | ) 8 | 9 | type ModuleFlagMiddleware struct { 10 | flagService *services.ModuleFlagStatusService 11 | } 12 | 13 | func NewModuleFlagMiddleware(db *database.Database) *ModuleFlagMiddleware { 14 | return &ModuleFlagMiddleware{ 15 | flagService: services.NewModuleFlagStatusService(db), 16 | } 17 | } 18 | 19 | // CheckModule dynamically checks if a module is enabled 20 | func (mid *ModuleFlagMiddleware) CheckModule(moduleCode string) fiber.Handler { 21 | return func(c *fiber.Ctx) error { 22 | flagStatus, err := mid.flagService.GetAll(c.Context()) 23 | if err != nil { 24 | return c.Status(fiber.StatusInternalServerError).SendString("Error retrieving module status") 25 | } 26 | if flagStatus[moduleCode] == "Disabled" { 27 | return c.Status(fiber.StatusForbidden).Render("_errors/error", fiber.Map{ 28 | "Title": "Module Error", 29 | "Message": "Module '" + moduleCode + "' is Disabled", 30 | }) 31 | } 32 | return c.Next() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /common/middlewares/requests.go: -------------------------------------------------------------------------------- 1 | package middlewares 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gofiber/fiber/v2" 6 | "github.com/ortizdavid/golang-modular-software/common/config" 7 | "go.uber.org/zap" 8 | ) 9 | 10 | type RequestLoggerMiddleware struct { 11 | logger * zap.Logger 12 | } 13 | 14 | func NewRequestLoggerMiddleware() *RequestLoggerMiddleware { 15 | return &RequestLoggerMiddleware{ 16 | logger: config.NewZapLogger("requests.log", zap.DebugLevel), 17 | } 18 | } 19 | 20 | func (mid *RequestLoggerMiddleware) Handle(ctx *fiber.Ctx) error { 21 | mid.logger.Info("Request", 22 | zap.String("Method", ctx.Method()), 23 | zap.String("Path", ctx.Path()), 24 | zap.String("StatusCode", fmt.Sprintf("%d", ctx.Response().StatusCode())), 25 | ) 26 | return ctx.Next() 27 | } 28 | -------------------------------------------------------------------------------- /common/middlewares/response.go: -------------------------------------------------------------------------------- 1 | package middlewares 2 | 3 | import "github.com/gofiber/fiber/v2" 4 | 5 | func unauthorizedResponse(c *fiber.Ctx, message string) error { 6 | return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{ 7 | "error": "Unauthorized", 8 | "message": message, 9 | }) 10 | } -------------------------------------------------------------------------------- /database/database.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "context" 5 | "gorm.io/gorm" 6 | ) 7 | 8 | type Database struct { 9 | *gorm.DB 10 | } 11 | 12 | func NewDatabase(db *gorm.DB) *Database { 13 | return &Database{ 14 | DB: db, 15 | } 16 | } 17 | 18 | // BeginTx starts a transaction 19 | func (d *Database) beginTx(ctx context.Context) (*Database, error) { 20 | tx := d.DB.WithContext(ctx).Begin() 21 | if tx.Error != nil { 22 | return nil, tx.Error 23 | } 24 | return &Database{DB: tx}, nil 25 | } 26 | 27 | // CommitTx commits the transaction 28 | func (d *Database) commitTx() error { 29 | return d.DB.Commit().Error 30 | } 31 | 32 | // RollbackTx rolls back the transaction 33 | func (d *Database) rollbackTx() error { 34 | return d.DB.Rollback().Error 35 | } 36 | 37 | // WithTx runs the provided function within a transaction 38 | // Rollback if an error occurred 39 | func (d *Database) WithTx(ctx context.Context, fn func(tx *Database) error) error{ 40 | tx, err := d.beginTx(ctx) 41 | if err != nil { 42 | return err 43 | } 44 | err = fn(tx) 45 | if err != nil { 46 | if rbErr := tx.rollbackTx(); rbErr != nil { 47 | return rbErr // rollback Error 48 | } 49 | return err // function error 50 | } 51 | return tx.commitTx() 52 | } 53 | 54 | -------------------------------------------------------------------------------- /database/seed/seed_database.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "github.com/ortizdavid/golang-modular-software/database" 5 | ) 6 | 7 | func SeedDatabase(db *database.Database) error { 8 | if err := InitDatabaseScripts(db); err != nil { 9 | return err 10 | } 11 | if err := CreateAdminUsers(db); err != nil { 12 | return err 13 | } 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /database/sql/_structure/configs-and-extensions.sql: -------------------------------------------------------------------------------- 1 | -- UUID 2 | CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; 3 | 4 | -------------------------------------------------------------------------------- /database/sql/_structure/drop-and.create.sql: -------------------------------------------------------------------------------- 1 | \c postgres 2 | 3 | -- DROP 4 | DROP DATABASE golang_modular_software; 5 | 6 | -- Create database 7 | CREATE DATABASE golang_modular_software ENCODING 'UTF8'; 8 | 9 | \c golang_modular_software; 10 | 11 | 12 | -------------------------------------------------------------------------------- /database/sql/_structure/schemas.sql: -------------------------------------------------------------------------------- 1 | -- SCHEMAS 2 | 3 | -- for all configurations 4 | CREATE SCHEMA IF NOT EXISTS configurations; 5 | 6 | -- user, roles, permission, authentication management 7 | CREATE SCHEMA IF NOT EXISTS authentication; 8 | 9 | -- company management 10 | CREATE SCHEMA IF NOT EXISTS company; 11 | 12 | -- employees management 13 | CREATE SCHEMA IF NOT EXISTS employees; 14 | 15 | -- reference management 16 | CREATE SCHEMA IF NOT EXISTS reference; 17 | 18 | -------------------------------------------------------------------------------- /database/sql/authentication/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'authentication' schema -------------------------------------------------------------------------------- /database/sql/authentication/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'authentication' schema 2 | 3 | -------------------------------------------------------------------------------- /database/sql/authentication/scripts.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/database/sql/authentication/scripts.sql -------------------------------------------------------------------------------- /database/sql/company/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'company' schema 2 | 3 | -------------------------------------------------------------------------------- /database/sql/company/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'company' schema 2 | -------------------------------------------------------------------------------- /database/sql/company/scripts.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/database/sql/company/scripts.sql -------------------------------------------------------------------------------- /database/sql/company/triggers.sql: -------------------------------------------------------------------------------- 1 | -- triggers for 'company' schema -------------------------------------------------------------------------------- /database/sql/configurations/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'configurations' schema -------------------------------------------------------------------------------- /database/sql/configurations/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'configurations' schema -------------------------------------------------------------------------------- /database/sql/configurations/scripts.sql: -------------------------------------------------------------------------------- 1 | -- Insert IDs into core_entity_flag for all modules based on the code 2 | INSERT INTO configurations.core_entity_flag (entity_id, module_id, status) 3 | SELECT ce.entity_id, 4 | CASE 5 | WHEN ce.code LIKE 'authentication.%' THEN 1 6 | WHEN ce.code LIKE 'configurations.%' THEN 2 7 | WHEN ce.code LIKE 'references.%' THEN 3 8 | WHEN ce.code LIKE 'company.%' THEN 4 9 | WHEN ce.code LIKE 'employees.%' THEN 5 10 | WHEN ce.code LIKE 'reports.%' THEN 6 11 | ELSE NULL 12 | END AS module_id, 13 | 'Disabled' AS status 14 | FROM configurations.core_entities ce 15 | WHERE ce.code LIKE 'authentication.%' 16 | OR ce.code LIKE 'configurations.%' 17 | OR ce.code LIKE 'references.%' 18 | OR ce.code LIKE 'company.%' 19 | OR ce.code LIKE 'employees.%' 20 | OR ce.code LIKE 'reports.%'; 21 | 22 | 23 | -- Update flags for configurations, set 'Enabled' 24 | UPDATE configurations.core_entity_flag 25 | SET status = 'Enabled' 26 | WHERE module_id = 2; 27 | 28 | -------------------------------------------------------------------------------- /database/sql/configurations/triggers.sql: -------------------------------------------------------------------------------- 1 | -- triggers for 'reference' schema -------------------------------------------------------------------------------- /database/sql/employees/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'employees' schema -------------------------------------------------------------------------------- /database/sql/employees/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'employees' schema 2 | 3 | 4 | -------------------------------------------------------------------------------- /database/sql/employees/scripts.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO employees.professional_info(employee_id, department_id, job_title_id, employment_status_id) 2 | SELECT employee_id, department_id, job_title_id, employment_status_id FROM employees.employees; 3 | 4 | -------------------------------------------------------------------------------- /database/sql/employees/triggers.sql: -------------------------------------------------------------------------------- 1 | -- triggers for 'employees' schema -------------------------------------------------------------------------------- /database/sql/references/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'reference' schema 2 | 3 | -------------------------------------------------------------------------------- /database/sql/references/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'reference' schema -------------------------------------------------------------------------------- /database/sql/references/scripts.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/database/sql/references/scripts.sql -------------------------------------------------------------------------------- /database/sql/references/triggers.sql: -------------------------------------------------------------------------------- 1 | -- triggers for 'reference' schema -------------------------------------------------------------------------------- /database/sql/reports/procedures.sql: -------------------------------------------------------------------------------- 1 | -- stored procedures for 'reports' database -------------------------------------------------------------------------------- /database/sql/reports/queries.sql: -------------------------------------------------------------------------------- 1 | -- queries for 'reports' schema -------------------------------------------------------------------------------- /database/sql/reports/scripts.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/database/sql/reports/scripts.sql -------------------------------------------------------------------------------- /database/sql/reports/tables.sql: -------------------------------------------------------------------------------- 1 | -- tables for 'reports' schema -------------------------------------------------------------------------------- /database/sql/reports/triggers.sql: -------------------------------------------------------------------------------- 1 | -- triggers for 'reports' schema -------------------------------------------------------------------------------- /database/sql/reports/views.sql: -------------------------------------------------------------------------------- 1 | -- views for 'reports' schema -------------------------------------------------------------------------------- /docs/_diagrams/.$Golang-Modular-Software.drawio.bkp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_diagrams/App Initalization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/App Initalization.png -------------------------------------------------------------------------------- /docs/_diagrams/Communication by Messaging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Communication by Messaging.png -------------------------------------------------------------------------------- /docs/_diagrams/Communication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Communication.png -------------------------------------------------------------------------------- /docs/_diagrams/Core Entity Structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Core Entity Structure.png -------------------------------------------------------------------------------- /docs/_diagrams/Coupling and Cohesion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Coupling and Cohesion.png -------------------------------------------------------------------------------- /docs/_diagrams/Dependency Between Modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Dependency Between Modules.png -------------------------------------------------------------------------------- /docs/_diagrams/Modular Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Modular Architecture.png -------------------------------------------------------------------------------- /docs/_diagrams/Modular Database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Modular Database.png -------------------------------------------------------------------------------- /docs/_diagrams/Module Creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Module Creation.png -------------------------------------------------------------------------------- /docs/_diagrams/Module Structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Module Structure.png -------------------------------------------------------------------------------- /docs/_diagrams/Modules - Flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Modules - Flow.png -------------------------------------------------------------------------------- /docs/_diagrams/Routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Routes.png -------------------------------------------------------------------------------- /docs/_diagrams/Schema-Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/docs/_diagrams/Schema-Objects.png -------------------------------------------------------------------------------- /docs/company/README.md: -------------------------------------------------------------------------------- 1 | # Company Module 2 | 3 | ## Overview 4 | The Company Module is designed to help organizations manage their internal structure efficiently. It provides tools to organize and maintain information about various organizational units, ensuring that all aspects of the company's physical and operational structure are well-documented and easily accessible. 5 | 6 | ## Features 7 | - **Departments:** Manage and organize different departments within the company, defining roles, responsibilities, and department-specific details. 8 | - **Branches:** Keep track of all company branches, including location information and branch-specific resources. 9 | - **Business Units:** Structure and manage various business units to reflect the company's operational divisions and strategies. 10 | - **Rooms:** Catalog and manage the allocation and usage of rooms within the company's premises, including meeting rooms, offices, and other spaces. 11 | - **Offices:** Maintain details about individual offices, including their locations, occupants, and purposes. 12 | 13 | -------------------------------------------------------------------------------- /docs/employees/README.md: -------------------------------------------------------------------------------- 1 | # Employees Module 2 | 3 | ## Overview 4 | The Employees Module is designed to efficiently manage all aspects of employee data, serving as a centralized hub for comprehensive employee information within the organization. 5 | 6 | ## Features 7 | - **Employee Management:** A robust suite for handling every aspect of employee data. 8 | - **Personal Data:** Maintain detailed records of employee personal information, including contact details, addresses, and identification. 9 | - **Professional Data:** Track employee job-related information such as job titles, roles, departments, and work history. 10 | - **Documents:** Manage and store essential employee documents such as resumes, contracts, certifications, and more. 11 | - **Family Data:** Keep track of employee family information for benefits administration and emergency contacts. 12 | - **Health Data:** Securely record and manage health-related data, including medical histories and insurance information. 13 | 14 | -------------------------------------------------------------------------------- /docs/references/README.md: -------------------------------------------------------------------------------- 1 | # References Module 2 | 3 | ## Overview 4 | The References Module serves as a centralized repository for shared data across the application. It standardizes common information, ensuring consistency and reducing redundancy in your system. 5 | 6 | ## Features 7 | - **Shared Data Repository:** Centralize common data used throughout the application. 8 | - **Countries and Cities:** Comprehensive lists of countries and cities for use in forms and records. 9 | - **Document Types:** Standardize document types such as passports, IDs, and licenses. 10 | - **Marital Status:** Define and manage various marital status options. 11 | - **Contact Types:** Categorize and manage different types of contacts (e.g., phone, email, social media). 12 | - **... and more:** Easily extendable to include other common reference data. 13 | -------------------------------------------------------------------------------- /docs/reports/README.md: -------------------------------------------------------------------------------- 1 | # Reports and Analytics Module 2 | 3 | ## Overview 4 | The Reports and Analytics Module provides powerful tools for generating insights and exporting data. It is designed to help organizations track key metrics, analyze performance, and make informed decisions. 5 | 6 | ## Features 7 | - **Interactive Dashboards:** Visualize key metrics with customizable dashboards. 8 | - **Dynamic Graphics:** Generate and analyze data with various types of charts and graphs. 9 | - **Export Capabilities:** Seamlessly export reports in multiple formats, including PDF, Excel, and CSV. 10 | - **Employee Reports:** Gain insights into employee performance and other HR metrics. 11 | - **Company Reports:** Analyze company-wide data for better strategic planning. 12 | - **User Reports:** Track user activity and engagement for improved management. 13 | 14 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "github.com/ortizdavid/golang-modular-software/application" 6 | ) 7 | 8 | func main() { 9 | // create and initialize the application 10 | app, err := application.NewApplication() 11 | if err != nil { 12 | log.Fatal(err.Error()) 13 | } 14 | 15 | // start the application 16 | err = app.Start() 17 | if err != nil { 18 | log.Fatal(err.Error()) 19 | } 20 | } -------------------------------------------------------------------------------- /modules/authentication/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterApiRoutes(router *fiber.App, db *database.Database) { 9 | NewAuthApi(db).Routes(router) 10 | NewUserApi(db).Routes(router, db) 11 | NewRoleApi(db).Routes(router, db) 12 | } -------------------------------------------------------------------------------- /modules/authentication/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | userInfoLogFile = "users-info.log" 5 | userErrorLogFile = "users-error.log" 6 | authInfoLogFile = "auth-info.log" 7 | authErrorLogFile = "auth-error.log" 8 | ) 9 | -------------------------------------------------------------------------------- /modules/authentication/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterControllerRoutes(router *fiber.App, db *database.Database) { 9 | NewAuthController(db).Routes(router) 10 | NewRootController(db).Routes(router, db) 11 | NewAccountController(db).Routes(router, db) 12 | NewRoleController(db).Routes(router, db) 13 | NewUserController(db).Routes(router, db) 14 | NewPermissionController(db).Routes(router, db) 15 | NewLoginActivityController(db).Routes(router, db) 16 | } 17 | -------------------------------------------------------------------------------- /modules/authentication/entities/login_activity_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type SearchLoginActivityRequest struct { 4 | SearchParam string `json:"search_param" form:"search_param"` 5 | } 6 | -------------------------------------------------------------------------------- /modules/authentication/entities/permission.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Permission struct { 8 | PermissionId int `gorm:"primaryKey;autoIncrement"` 9 | PermissionName string`gorm:"column:permission_name"` 10 | Code string `gorm:"column:code"` 11 | Description string `gorm:"column:description"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (Permission) TableName() string { 16 | return "authentication.permissions" 17 | } 18 | 19 | type PermissionData struct { 20 | PermissionId int `json:"permission_id"` 21 | UniqueId string `json:"unique_id"` 22 | PermissionName string `json:"permission_name"` 23 | Code string `json:"code"` 24 | Description string `json:"description"` 25 | CreatedAt string `json:"created_at"` 26 | UpdatedAt string `json:"updated_at"` 27 | } 28 | -------------------------------------------------------------------------------- /modules/authentication/entities/permission_role.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type PermissionRole struct { 8 | PermissionRoleId int64 `gorm:"primaryKey;autoIncrement"` 9 | PermissionId int64 `gorm:"column:permission_id"` 10 | RoleId int `gorm:"column:role_id"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (PermissionRole) TableName() string { 15 | return "authentication.permission_roles" 16 | } 17 | 18 | type PermissionRoleData struct { 19 | PermissionRoleId int `json:"permission_role_id"` 20 | UniqueId string `json:"unique_id"` 21 | Code string `json:"code_at"` 22 | CreatedAt string `json:"created_at"` 23 | UpdateAt string `json:"updated_at"` 24 | PermissionId int `json:"permission_id"` 25 | PermissionName string `json:"permission_name"` 26 | PermissionCode string `json:"permission_code"` 27 | RoleId int `json:"role_id"` 28 | RoleUniqueId string `json:"role_unique_id"` 29 | RoleName string `json:"role_name"` 30 | } 31 | -------------------------------------------------------------------------------- /modules/authentication/entities/role.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Role struct { 8 | RoleId int `gorm:"primaryKey;autoIncrement"` 9 | RoleName string`gorm:"column:role_name"` 10 | Code string `gorm:"column:code"` 11 | Description string `gorm:"column:description"` 12 | Status string `gorm:"column:status"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (Role) TableName() string { 17 | return "authentication.roles" 18 | } 19 | 20 | type RoleData struct { 21 | RoleId int `json:"role_id"` 22 | UniqueId string `json:"unique_id"` 23 | RoleName string `json:"role_name"` 24 | Code string `json:"code"` 25 | Description string `json:"description"` 26 | Status string `json:"status"` 27 | CreatedAt string `json:"created_at"` 28 | UpdatedAt string `json:"updated_at"` 29 | } 30 | -------------------------------------------------------------------------------- /modules/authentication/entities/role_info.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type RoleInfo struct { 4 | Id int 5 | Code string 6 | } 7 | 8 | var ( 9 | RoleSuperAdmin = RoleInfo{Id: 1, Code: "role_super_admin"} 10 | RoleAdmin = RoleInfo{Id: 2, Code: "role_admin"} 11 | RoleManager = RoleInfo{Id: 3, Code: "role_manager"} 12 | RoleEmployee = RoleInfo{Id: 4, Code: "role_employee"} 13 | RoleCustomer = RoleInfo{Id: 5, Code: "role_customer"} 14 | RoleSupplier = RoleInfo{Id: 6, Code: "role_supplier"} 15 | RoleSupport = RoleInfo{Id: 7, Code: "role_support"} 16 | RoleDeveloper = RoleInfo{Id: 8, Code: "role_developer"} 17 | RoleGuest = RoleInfo{Id: 9, Code: "role_guest"} 18 | ) 19 | -------------------------------------------------------------------------------- /modules/authentication/entities/statistics.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type Statistics struct { 4 | Users int64 `json:"users"` 5 | ActiveUsers int64 `json:"active_users"` 6 | InactiveUsers int64 `json:"inactive_users"` 7 | OnlineUsers int64 `json:"online_users"` 8 | OfflineUsers int64 `json:"offline_users"` 9 | Roles int64 `json:"roles"` 10 | Permissions int64 `json:"permissions"` 11 | LoginActivity int64 `json:"login_activity"` 12 | } 13 | -------------------------------------------------------------------------------- /modules/authentication/entities/user_association.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type UserAssociation struct { 8 | AssociationId int64 `gorm:"primaryKey;autoIncrement"` 9 | UserId int64 `gorm:"column:user_id"` 10 | EntityId int64 `gorm:"column:entity_id"` 11 | EntityName string `gorm:"column:entity_name"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (UserAssociation) TableName() string { 16 | return "authentication.user_associations" 17 | } -------------------------------------------------------------------------------- /modules/authentication/entities/user_role.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type UserRole struct { 8 | UserRoleId int64 `gorm:"primaryKey;autoIncrement"` 9 | UserId int64 `gorm:"column:user_id"` 10 | RoleId int `gorm:"column:role_id"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (UserRole) TableName() string { 15 | return "authentication.user_roles" 16 | } 17 | 18 | type UserRoleData struct { 19 | UserRoleId int64 `json:"user_role_id"` 20 | UniqueId string `json:"unique_id"` 21 | CreatedAt string `json:"created_at"` 22 | UpdatedAt string `json:"updated_at"` 23 | RoleId int64 `json:"role_id"` 24 | RoleName string `json:"role_name"` 25 | RoleCode string `json:"role_code"` 26 | RoleStatus string `json:"role_status"` 27 | UserId int64 `json:"user_id"` 28 | UserUniqueId string `json:"user_unique_id"` 29 | UserName string `json:"user_name"` 30 | } -------------------------------------------------------------------------------- /modules/authentication/repositories/statistics_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/authentication/entities" 8 | ) 9 | 10 | type StatisticsRepository struct { 11 | db *database.Database 12 | } 13 | 14 | func NewStatisticsRepository(db *database.Database) *StatisticsRepository { 15 | return &StatisticsRepository{ 16 | db: db, 17 | } 18 | } 19 | 20 | func (repo *StatisticsRepository) GetStatistics(ctx context.Context) (entities.Statistics, error) { 21 | var statistics entities.Statistics 22 | result := repo.db.WithContext(ctx).Raw("SELECT * FROM authentication.view_statistics_data;").Scan(&statistics) 23 | return statistics, result.Error 24 | } 25 | -------------------------------------------------------------------------------- /modules/authentication/repositories/user_association_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/authentication/entities" 8 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 9 | ) 10 | 11 | type UserAssociationRepository struct { 12 | db *database.Database 13 | *shared.BaseRepository[entities.UserAssociation] 14 | } 15 | 16 | func NewUserAssociationRepository(db *database.Database) *UserAssociationRepository { 17 | return &UserAssociationRepository{ 18 | db: db, 19 | BaseRepository: shared.NewBaseRepository[entities.UserAssociation](db), 20 | } 21 | } 22 | 23 | func (repo *UserAssociationRepository) Exists(ctx context.Context, entityId int64) (bool, error) { 24 | var association entities.UserAssociation 25 | result := repo.db.WithContext(ctx).Where("entity_id=?", entityId).Find(&association) 26 | return association.AssociationId !=0 , result.Error 27 | } -------------------------------------------------------------------------------- /modules/authentication/services/statistics_service.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/authentication/entities" 8 | "github.com/ortizdavid/golang-modular-software/modules/authentication/repositories" 9 | ) 10 | 11 | type StatisticsService struct { 12 | repository *repositories.StatisticsRepository 13 | } 14 | 15 | func NewStatisticsService(db *database.Database) *StatisticsService { 16 | return &StatisticsService{ 17 | repository: repositories.NewStatisticsRepository(db), 18 | } 19 | } 20 | 21 | func (s *StatisticsService) GetStatistics(ctx context.Context) (entities.Statistics, error) { 22 | statistics, err := s.repository.GetStatistics(ctx) 23 | if err != nil { 24 | return entities.Statistics{}, err 25 | } 26 | return statistics, nil 27 | } 28 | -------------------------------------------------------------------------------- /modules/authentication/services/user_service_count.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/common/apperrors" 7 | entities "github.com/ortizdavid/golang-modular-software/modules/authentication/entities" 8 | ) 9 | 10 | func (s *UserService) CountUsers(ctx context.Context) (int64, error) { 11 | count, err := s.repository.Count(ctx) 12 | if err != nil { 13 | return 0, apperrors.NotFoundError("No users found") 14 | } 15 | return count, nil 16 | } 17 | 18 | func (s *UserService) CountUsersByStatus(ctx context.Context, status bool) (int64, error) { 19 | count, err := s.repository.CountByStatus(ctx, status) 20 | if err != nil { 21 | return 0, apperrors.NotFoundError("No users found") 22 | } 23 | return count, nil 24 | } 25 | 26 | func (s *UserService) CountUsersByActivityStatus(ctx context.Context, status entities.LoginActivityStatus) (int64, error) { 27 | count, err := s.repository.CountByActivityStatus(ctx, status) 28 | if err != nil { 29 | return 0, apperrors.NotFoundError("No users found") 30 | } 31 | return count, nil 32 | } 33 | -------------------------------------------------------------------------------- /modules/back_office/README.md: -------------------------------------------------------------------------------- 1 | Here's an improved version of your `README.md` file for the Back Office section: 2 | 3 | --- 4 | 5 | # Back Office 6 | 7 | ## Overview 8 | The Back Office serves as the administrative entry point of the application, providing essential tools and interfaces for managing the application's core operations. It is the central hub for administrators and staff to oversee and control various aspects of the system. 9 | 10 | ## Features 11 | - **Home Page:** The primary landing page for the Back Office, offering quick access to administrative functions, key metrics, and system management tools. 12 | 13 | -------------------------------------------------------------------------------- /modules/back_office/controllers/api_root_controller.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "path/filepath" 5 | "github.com/gofiber/fiber/v2" 6 | ) 7 | 8 | type ApiRootController struct { 9 | } 10 | 11 | func (ctrl ApiRootController) Routes(router *fiber.App) { 12 | group := router.Group("/api") 13 | group.Get("", ctrl.index) 14 | group.Get("/download-collections", ctrl.downloadCollections) 15 | } 16 | 17 | func (ctrl ApiRootController) index(c *fiber.Ctx) error { 18 | return c.Render("_back_office/api-root", fiber.Map{ 19 | "Title": "API Collection", 20 | }) 21 | } 22 | 23 | func (ctrl *ApiRootController) downloadCollections(c *fiber.Ctx) error { 24 | path := "./docs/_api/" 25 | fileName := "Golang Modular Software.postman_collection.json" 26 | c.Set("Content-Disposition", "attachment; filename="+fileName) 27 | c.Set("Content-Type", "application/json") 28 | return c.SendFile(filepath.Join(path, fileName)) 29 | } 30 | -------------------------------------------------------------------------------- /modules/back_office/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | ApiRootController{}.Routes(router) 10 | NewBackOfficeController(db).Routes(router, db) 11 | } 12 | -------------------------------------------------------------------------------- /modules/back_office/module_routes.go: -------------------------------------------------------------------------------- 1 | package back_office 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | "github.com/ortizdavid/golang-modular-software/modules/back_office/controllers" 7 | ) 8 | 9 | func RegisterModuleRoutes(router *fiber.App, db *database.Database) { 10 | controllers.RegisterRoutes(router, db) 11 | } -------------------------------------------------------------------------------- /modules/company/api/helper.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | const ( 4 | infoLogFile = "company-info.log" 5 | errorLogFile = "company-error.log" 6 | ) 7 | -------------------------------------------------------------------------------- /modules/company/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewCompanyApi(db).Routes(router, db) 10 | NewBranchApi(db).Routes(router, db) 11 | NewOfficeApi(db).Routes(router, db) 12 | NewDepartmentApi(db).Routes(router, db) 13 | NewRoomApi(db).Routes(router, db) 14 | NewProjectApi(db).Routes(router, db) 15 | NewPolicyApi(db).Routes(router, db) 16 | } -------------------------------------------------------------------------------- /modules/company/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | infoLogFile = "company-info.log" 5 | errorLogFile = "company-error.log" 6 | ) 7 | -------------------------------------------------------------------------------- /modules/company/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewRootController(db).Routes(router, db) 10 | NewCompanyController(db).Routes(router, db) 11 | NewBranchController(db).Routes(router, db) 12 | NewOfficeController(db).Routes(router, db) 13 | NewRoomController(db).Routes(router, db) 14 | NewDepartmentController(db).Routes(router, db) 15 | NewPolicyController(db).Routes(router, db) 16 | NewProjectController(db).Routes(router, db) 17 | } 18 | -------------------------------------------------------------------------------- /modules/company/entities/branch.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Branch struct { 8 | BranchId int `gorm:"primaryKey;autoIncrement"` 9 | CompanyId int `gorm:"column:company_id"` 10 | BranchName string `gorm:"column:branch_name"` 11 | Code string `gorm:"column:code"` 12 | Address string `gorm:"column:address"` 13 | Phone string `gorm:"column:phone"` 14 | Email string `gorm:"column:email"` 15 | shared.BaseEntity 16 | } 17 | 18 | func (Branch) TableName() string { 19 | return "company.branches" 20 | } 21 | 22 | type BranchData struct { 23 | BranchId int `json:"branch_id"` 24 | UniqueId string `json:"unique_id"` 25 | BranchName string `json:"branch_name"` 26 | Code string `json:"code"` 27 | Address string `json:"address"` 28 | Phone string `json:"phone"` 29 | Email string `json:"email"` 30 | CreatedAt string `json:"created_at"` 31 | UpdatedAt string `json:"updated_at"` 32 | CompanyId int `json:"company_id"` 33 | CompanyName string `json:"company_name"` 34 | } -------------------------------------------------------------------------------- /modules/company/entities/department.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Department struct { 8 | DepartmentId int `gorm:"primaryKey;autoIncrement"` 9 | CompanyId int `gorm:"column:company_id"` 10 | DepartmentName string `gorm:"column:department_name"` 11 | Acronym string `gorm:"column:acronym"` 12 | Description string `gorm:"column:description"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (Department) TableName() string { 17 | return "company.departments" 18 | } 19 | 20 | type DepartmentData struct { 21 | DepartmentId int `json:"department_id"` 22 | DepartmentName string `json:"department_name"` 23 | Acronym string `json:"acronym"` 24 | Description string `json:"description"` 25 | UniqueId string `json:"unique_id"` 26 | CreatedAt string `json:"created_at"` 27 | UpdatedAt string `json:"updated_at"` 28 | CompanyId int `json:"company_id"` 29 | CompanyName string `json:"company_name"` 30 | } 31 | -------------------------------------------------------------------------------- /modules/company/entities/office.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Office struct { 8 | OfficeId int `gorm:"primaryKey;autoIncrement"` 9 | CompanyId int `gorm:"column:company_id"` 10 | OfficeName string `gorm:"column:office_name"` 11 | Code string `gorm:"column:code"` 12 | Address string `gorm:"column:address"` 13 | Phone string `gorm:"column:phone"` 14 | Email string `gorm:"column:email"` 15 | shared.BaseEntity 16 | } 17 | 18 | func (Office) TableName() string { 19 | return "company.offices" 20 | } 21 | 22 | type OfficeData struct { 23 | OfficeId int `json:"office_id"` 24 | UniqueId string `json:"unique_id"` 25 | OfficeName string `json:"office_name"` 26 | Code string `json:"code"` 27 | Address string `json:"address"` 28 | Phone string `json:"phone"` 29 | Email string `json:"email"` 30 | CreatedAt string `json:"created_at"` 31 | UpdatedAt string `json:"updated_at"` 32 | CompanyId int `json:"company_id"` 33 | CompanyName string `json:"company_name"` 34 | } -------------------------------------------------------------------------------- /modules/company/entities/policy.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "time" 5 | 6 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 7 | ) 8 | 9 | type Policy struct { 10 | PolicyId int `gorm:"primaryKey;autoIncrement"` 11 | CompanyId int `gorm:"column:company_id"` 12 | PolicyName string `gorm:"column:policy_name"` 13 | Description string `gorm:"column:description"` 14 | EffectiveDate time.Time `gorm:"column:effective_date"` 15 | shared.BaseEntity 16 | } 17 | 18 | func (Policy) TableName() string { 19 | return "company.policies" 20 | } 21 | 22 | type PolicyData struct { 23 | PolicyId int `json:"policy_id"` 24 | UniqueId string `json:"unique_id"` 25 | PolicyName string `json:"policy_name"` 26 | Description string `json:"description"` 27 | EffectiveDate string `json:"effective_date"` 28 | CreatedAt string `json:"created_at"` 29 | UpdatedAt string `json:"updated_at"` 30 | CompanyId int `json:"company_id"` 31 | CompanyName string `json:"company_name"` 32 | } 33 | -------------------------------------------------------------------------------- /modules/company/entities/policy_attachment.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type PolicyAttachment struct { 8 | AttachmentId int `gorm:"primaryKey;autoIncrement"` 9 | PolicyId int `gorm:"column:policy_id"` 10 | CompanyId int `gorm:"column:company_id"` 11 | AttachmentName string `gorm:"column:attachment_name"` 12 | FileName string `gorm:"column:file_name"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (PolicyAttachment) TableName() string { 17 | return "company.policy_attachments" 18 | } -------------------------------------------------------------------------------- /modules/company/entities/project.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "time" 5 | 6 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 7 | ) 8 | 9 | type Project struct { 10 | ProjectId int `gorm:"primaryKey;autoIncrement"` 11 | ProjectName string `gorm:"column:project_name"` 12 | Description string `gorm:"column:description"` 13 | StartDate time.Time `gorm:"column:start_date"` 14 | EndDate time.Time `gorm:"column:end_date"` 15 | Status string `gorm:"column:status"` 16 | CompanyId int `gorm:"column:company_id"` 17 | shared.BaseEntity 18 | } 19 | 20 | func (Project) TableName() string { 21 | return "company.projects" 22 | } 23 | 24 | type ProjectData struct { 25 | ProjectId int `json:"project_id"` 26 | UniqueId string `json:"unique_id"` 27 | ProjectName string `json:"project_name"` 28 | Description string `json:"description"` 29 | StartDate string `json:"start_date"` 30 | EndDate string `json:"end_date"` 31 | Status string `json:"status"` 32 | CreatedAt string `json:"created_at"` 33 | UpdatedAt string `json:"updated_at"` 34 | CompanyId int `json:"company_id"` 35 | CompanyName string `json:"company_name"` 36 | } -------------------------------------------------------------------------------- /modules/company/entities/project_attachment.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type ProjectAttachment struct { 8 | AttachmentId int `gorm:"primaryKey;autoIncrement"` 9 | ProjectId int `gorm:"column:project_id"` 10 | CompanyId int `gorm:"column:company_id"` 11 | AttachmentName string `gorm:"column:attachment_name"` 12 | FileName string `gorm:"column:file_name"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (ProjectAttachment) TableName() string { 17 | return "company.project_attachments" 18 | } -------------------------------------------------------------------------------- /modules/company/entities/room.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Room struct { 8 | RoomId int `gorm:"primaryKey;autoIncrement"` 9 | CompanyId int `gorm:"column:company_id"` 10 | BranchId int `gorm:"column:branch_id"` 11 | RoomName string `gorm:"column:room_name"` 12 | Number string `gorm:"column:number"` 13 | Capacity int `gorm:"column:capacity"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (Room) TableName() string { 18 | return "company.rooms" 19 | } 20 | 21 | type RoomData struct { 22 | RoomId int `json:"room_id"` 23 | RoomName string `json:"room_name"` 24 | Number string `json:"number"` 25 | Capacity int `json:"capacity"` 26 | UniqueId string `json:"unique_id"` 27 | CreatedAt string `json:"created_at"` 28 | UpdatedAt string `json:"updated_at"` 29 | CompanyId int `json:"company_id"` 30 | CompanyName string `json:"company_name"` 31 | BranchId int `json:"branch_id"` 32 | BranchName string `json:"branch_name"` 33 | } 34 | -------------------------------------------------------------------------------- /modules/company/entities/statitstics.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type Statistics struct { 4 | Branches int64 `json:"branches"` 5 | Offices int64 `json:"offices"` 6 | Departments int64 `json:"departments"` 7 | Rooms int64 `json:"rooms"` 8 | Projects int64 `json:"projects"` 9 | Policies int64 `json:"policies"` 10 | } -------------------------------------------------------------------------------- /modules/company/repositories/policy_attachment_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/company/entities" 8 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 9 | ) 10 | 11 | type PolicyAttachmentRepository struct { 12 | db *database.Database 13 | *shared.BaseRepository[entities.PolicyAttachment] 14 | } 15 | 16 | func NewPolicyAttachmentRepository(db *database.Database) *PolicyAttachmentRepository { 17 | return &PolicyAttachmentRepository{ 18 | db: db, 19 | BaseRepository: shared.NewBaseRepository[entities.PolicyAttachment](db), 20 | } 21 | } 22 | 23 | func (repo *PolicyAttachmentRepository) FindAllByPolicyId(ctx context.Context, policyId int) ([]entities.PolicyAttachment, error) { 24 | var attachments []entities.PolicyAttachment 25 | result := repo.db.WithContext(ctx).Where("policy_id = ?", policyId).Find(&attachments) 26 | return attachments, result.Error 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /modules/company/repositories/project_attachment_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/company/entities" 8 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 9 | ) 10 | 11 | type ProjectAttachmentRepository struct { 12 | db *database.Database 13 | *shared.BaseRepository[entities.ProjectAttachment] 14 | } 15 | 16 | func NewProjectAttachmentRepository(db *database.Database) *ProjectAttachmentRepository { 17 | return &ProjectAttachmentRepository{ 18 | db: db, 19 | BaseRepository: shared.NewBaseRepository[entities.ProjectAttachment](db), 20 | } 21 | } 22 | 23 | func (repo *ProjectAttachmentRepository) FindAllByProjectId(ctx context.Context, projectId int) ([]entities.ProjectAttachment, error) { 24 | var attachments []entities.ProjectAttachment 25 | result := repo.db.WithContext(ctx).Where("project_id = ?", projectId).Find(&attachments) 26 | return attachments, result.Error 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /modules/company/repositories/statistics_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/company/entities" 8 | ) 9 | 10 | type StatisticsRepository struct { 11 | db *database.Database 12 | } 13 | 14 | func NewStatisticsRepository(db *database.Database) *StatisticsRepository { 15 | return &StatisticsRepository{ 16 | db: db, 17 | } 18 | } 19 | 20 | func (repo *StatisticsRepository) GetStatistics(ctx context.Context) (entities.Statistics, error) { 21 | var statistics entities.Statistics 22 | result := repo.db.WithContext(ctx).Raw("SELECT * FROM company.view_statistics_data;").Scan(&statistics) 23 | return statistics, result.Error 24 | } 25 | -------------------------------------------------------------------------------- /modules/company/services/statistics_service.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/company/entities" 8 | "github.com/ortizdavid/golang-modular-software/modules/company/repositories" 9 | ) 10 | 11 | type StatisticsService struct { 12 | repository *repositories.StatisticsRepository 13 | } 14 | 15 | func NewStatisticsService(db *database.Database) *StatisticsService { 16 | return &StatisticsService{ 17 | repository: repositories.NewStatisticsRepository(db), 18 | } 19 | } 20 | 21 | func (s *StatisticsService) GetStatistics(ctx context.Context) (entities.Statistics, error) { 22 | statistics, err := s.repository.GetStatistics(ctx) 23 | if err != nil { 24 | return entities.Statistics{}, err 25 | } 26 | return statistics, nil 27 | } 28 | -------------------------------------------------------------------------------- /modules/configurations/api/helper.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | const ( 4 | infoLogFile = "configurations-info.log" 5 | errorLogFile = "configurations-error.log" 6 | ) 7 | -------------------------------------------------------------------------------- /modules/configurations/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewBasicConfigurationApi(db).Routes(router, db) 10 | NewCompanyConfigurationApi(db).Routes(router, db) 11 | NewEmailConfigurationApi(db).Routes(router, db) 12 | NewModuleFlagApi(db).Routes(router, db) 13 | NewCoreEntityFlagApi(db).Routes(router, db) 14 | } -------------------------------------------------------------------------------- /modules/configurations/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | infoLogFile = "configurations-info.log" 5 | errorLogFile = "configurations-error.log" 6 | ) 7 | -------------------------------------------------------------------------------- /modules/configurations/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewRootController(db).Routes(router, db) 10 | NewBasicConfigurationController(db).Routes(router, db) 11 | NewCompanyConfigurationController(db).Routes(router, db) 12 | NewEmailConfigurationController(db).Routes(router, db) 13 | NewModuleFlagController(db).Routes(router, db) 14 | NewCoreEntityController(db).Routes(router, db) 15 | NewCoreEntityFlagController(db).Routes(router, db) 16 | } 17 | -------------------------------------------------------------------------------- /modules/configurations/entities/app_configuration.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | 4 | type AppConfiguration struct { 5 | BasicConfig BasicConfiguration `json:"basic_config"` 6 | CompanyConfig CompanyConfiguration `json:"company_config"` 7 | EmailConfig EmailConfiguration `json:"email_config"` 8 | } 9 | -------------------------------------------------------------------------------- /modules/configurations/entities/basic_configuration.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type BasicConfiguration struct { 8 | ConfigurationId int `gorm:"autoIncrement;primaryKey" json:"configuration_id"` 9 | AppName string `gorm:"column:app_name" json:"app_name"` 10 | AppAcronym string `gorm:"column:app_acronym" json:"app_acronym"` 11 | MaxRecordsPerPage int `gorm:"column:max_records_per_page" json:"max_records_per_page"` 12 | MaxAdmninUsers int `gorm:"column:max_admin_users" json:"max_admin_users"` 13 | MaxSuperAdmninUsers int `gorm:"column:max_super_admin_users" json:"max_super_admin_users"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (BasicConfiguration) TableName() string { 18 | return "configurations.basic_configuration" 19 | } 20 | -------------------------------------------------------------------------------- /modules/configurations/entities/basic_configuration_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/go-playground/validator/v10" 5 | "github.com/ortizdavid/golang-modular-software/common/helpers" 6 | ) 7 | 8 | type UpdateBasicConfigurationRequest struct { 9 | AppName string `json:"app_name" form:"app_name" validate:"required,min=5,max=100"` 10 | AppAcronym string `json:"app_acronym" form:"app_acronym" validate:"required,min=3,max=50"` 11 | MaxAdmninUsers int `json:"max_admin_users" form:"max_admin_users" validate:"required,max=20"` 12 | MaxSuperAdminUsers int `json:"max_super_admin_users" form:"max_super_admin_users" validate:"required,max=10"` 13 | MaxRecordPerPage int `json:"max_record_per_page" form:"max_record_per_page" validate:"required,min=10,max=100"` 14 | } 15 | 16 | func (req UpdateBasicConfigurationRequest) Validate() error { 17 | validate := validator.New() 18 | err := validate.Struct(req) 19 | if err != nil { 20 | if errs, ok := err.(validator.ValidationErrors); ok { 21 | return helpers.ValidatorFormatErrors(errs) 22 | } 23 | return err 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /modules/configurations/entities/company_configuration.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type CompanyConfiguration struct { 8 | ConfigurationId int `gorm:"autoIncrement;primaryKey" json:"configuration_id"` 9 | CompanyName string `gorm:"column:company_name" json:"company_name"` 10 | CompanyAcronym string `gorm:"column:company_acronym" json:"company_acronym"` 11 | CompanyMainColor string `gorm:"column:company_main_color" json:"company_main_color"` 12 | CompanyLogo string `gorm:"column:company_logo" json:"company_logo"` 13 | CompanyPhone string `gorm:"column:company_phone" json:"company_phone"` 14 | CompanyEmail string `gorm:"column:company_email" json:"company_email"` 15 | shared.BaseEntity 16 | } 17 | 18 | func (CompanyConfiguration) TableName() string { 19 | return "configurations.company_configuration" 20 | } 21 | -------------------------------------------------------------------------------- /modules/configurations/entities/company_configuration_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/go-playground/validator/v10" 5 | "github.com/ortizdavid/golang-modular-software/common/helpers" 6 | ) 7 | 8 | type UpdateCompanyConfigurationRequest struct { 9 | CompanyName string `json:"company_name" form:"company_name" validate:"required,min=5,max=100"` 10 | CompanyAcronym string `json:"company_acronym" form:"company_acronym" validate:"required,min=2,max=50"` 11 | CompanyPhone string `json:"company_phone" form:"company_phone" validate:"required,max=20"` 12 | CompanyEmail string `json:"company_email" form:"company_email" validate:"required,min=8,max=100"` 13 | CompanyMainColor string `json:"company_main_color" form:"company_main_color" validate:"required,max=10"` 14 | CompanyLogo string `json:"company_logo" form:"company_logo" validate:"max=100"` 15 | } 16 | 17 | func (req UpdateCompanyConfigurationRequest) Validate() error { 18 | validate := validator.New() 19 | err := validate.Struct(req) 20 | if err != nil { 21 | if errs, ok := err.(validator.ValidationErrors); ok { 22 | return helpers.ValidatorFormatErrors(errs) 23 | } 24 | return err 25 | } 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /modules/configurations/entities/core_entity.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type CoreEntity struct { 8 | EntityId int `gorm:"primaryKey;autoIncrement"` 9 | ModuleId int `gorm:"column:module_id"` 10 | EntityName string `gorm:"column:entity_name"` 11 | Code string `gorm:"column:code"` 12 | Description string `gorm:"column:description"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (CoreEntity) TableName() string { 17 | return "configurations.core_entities" 18 | } 19 | 20 | type CoreEntityData struct { 21 | EntityId int `json:"entity_id"` 22 | UniqueId string `json:"unique_id"` 23 | EntityName string `json:"entity_name"` 24 | Code string `json:"code"` 25 | Description string `json:"description"` 26 | CreatedAt string `json:"created_at"` 27 | UpdatedAt string `json:"updated_at"` 28 | ModuleId int `json:"module_id"` 29 | ModuleName string `json:"module_name"` 30 | } 31 | -------------------------------------------------------------------------------- /modules/configurations/entities/core_entity_flag.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type CoreEntityFlag struct { 8 | FlagId int `gorm:"primaryKey;autoIncrement"` 9 | EntityId int `gorm:"column:entity_id"` 10 | ModuleId int `gorm:"column:module_id"` 11 | Status string `gorm:"column:status"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (CoreEntityFlag) TableName() string { 16 | return "configurations.core_entity_flag" 17 | } 18 | 19 | type CoreEntityFlagData struct { 20 | FlagId int `json:"flag_id"` 21 | UniqueId string `json:"unique_id"` 22 | Status string `json:"status"` 23 | CreatedAt string `json:"created_at"` 24 | UpdatedAt string `json:"updated_at"` 25 | EntityId int `json:"entity_id"` 26 | EntityName string `json:"entity_name"` 27 | Code string `json:"code"` 28 | ModuleId int `json:"module_id"` 29 | ModuleName string `json:"module_name"` 30 | ModuleCode string `json:"module_code"` 31 | } 32 | -------------------------------------------------------------------------------- /modules/configurations/entities/core_entity_flag_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/go-playground/validator/v10" 7 | "github.com/ortizdavid/golang-modular-software/common/helpers" 8 | ) 9 | 10 | type ManageCoreEntityFlagRequest struct { 11 | FlagId int `json:"flag_id" form:"flag_id" validate:"required"` 12 | Status string `json:"statuses" form:"status" validate:"required,oneof=Enabled Disabled"` 13 | } 14 | 15 | func (req ManageCoreEntityFlagRequest) Validate() error { 16 | validate := validator.New() 17 | err := validate.Struct(req) 18 | if err != nil { 19 | if errs, ok := err.(validator.ValidationErrors); ok { 20 | return helpers.ValidatorFormatErrors(errs) 21 | } 22 | return err 23 | } 24 | if req.Status != "Enabled" && req.Status != "Disabled" { 25 | return fmt.Errorf("invalid status: %s", req.Status) 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /modules/configurations/entities/email_configuration.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type EmailConfiguration struct { 8 | ConfigurationId int `gorm:"autoIncrement;primaryKey" json:"configuration_id"` 9 | SMTPServer string `gorm:"column:smtp_server" json:"smtp_server"` 10 | SMTPPort string `gorm:"column:smtp_port" json:"smtp_port"` 11 | SenderEmail string `gorm:"column:sender_email" json:"sender_email"` 12 | SenderPassword string `gorm:"column:sender_password" json:"sender_password"` 13 | shared.BaseEntity 14 | } 15 | 16 | func (EmailConfiguration) TableName() string { 17 | return "configurations.email_configuration" 18 | } 19 | -------------------------------------------------------------------------------- /modules/configurations/entities/email_configuration_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/go-playground/validator/v10" 5 | "github.com/ortizdavid/golang-modular-software/common/helpers" 6 | ) 7 | 8 | type UpdateEmailConfigurationRequest struct { 9 | SMTPServer string `json:"smtp_server" form:"smtp_server" validate:"required,min=8,max=50"` 10 | SMTPPort string `json:"smtp_port" form:"smtp_port" validate:"required,max=5"` 11 | SenderEmail string `json:"sender_email" form:"sender_email" validate:"required,min=8,max=100"` 12 | SenderPassword string `json:"sender_password" form:"sender_password" validate:"required,min=8,max=150"` 13 | } 14 | 15 | func (req UpdateEmailConfigurationRequest) Validate() error { 16 | validate := validator.New() 17 | err := validate.Struct(req) 18 | if err != nil { 19 | if errs, ok := err.(validator.ValidationErrors); ok { 20 | return helpers.ValidatorFormatErrors(errs) 21 | } 22 | return err 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /modules/configurations/entities/module.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Module struct { 8 | ModuleId int `gorm:"primaryKey;autoIncrement"` 9 | ModuleName string `gorm:"column:module_name"` 10 | Code string `gorm:"column:code"` 11 | Description string `gorm:"column:description"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (Module) TableName() string { 16 | return "configurations.modules" 17 | } 18 | -------------------------------------------------------------------------------- /modules/configurations/entities/module_flag.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type ModuleFlag struct { 8 | FlagId int `gorm:"primaryKey;autoIncrement"` 9 | ModuleId int `gorm:"column:module_id"` 10 | Status string `gorm:"column:status"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (ModuleFlag) TableName() string { 15 | return "configurations.module_flag" 16 | } 17 | 18 | type ModuleFlagData struct { 19 | FlagId int `json:"flag_id"` 20 | UniqueId string `json:"unique_id"` 21 | Status string `json:"status"` 22 | CreatedAt string `json:"created_at"` 23 | UpdatedAt string `json:"updated_at"` 24 | ModuleId int `json:"module_id"` 25 | ModuleName string `json:"module_name"` 26 | Code string `json:"code"` 27 | } 28 | -------------------------------------------------------------------------------- /modules/configurations/entities/module_flag_request.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/go-playground/validator/v10" 7 | "github.com/ortizdavid/golang-modular-software/common/helpers" 8 | ) 9 | 10 | type ManageModuleFlagRequest struct { 11 | FlagId int `json:"flag_id" form:"flag_id" validate:"required"` 12 | Status string `json:"statuses" form:"status" validate:"required,oneof=Enabled Disabled"` 13 | } 14 | 15 | func (req ManageModuleFlagRequest) Validate() error { 16 | validate := validator.New() 17 | err := validate.Struct(req) 18 | if err != nil { 19 | if errs, ok := err.(validator.ValidationErrors); ok { 20 | return helpers.ValidatorFormatErrors(errs) 21 | } 22 | return err 23 | } 24 | if req.Status != "Enabled" && req.Status != "Disabled" { 25 | return fmt.Errorf("invalid status: %s", req.Status) 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /modules/configurations/entities/module_flag_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type ModuleFlagStatus struct { 4 | Authentication string `json:"authentication"` 5 | Configurations string `json:"configurations"` 6 | References string `json:"references"` 7 | Company string `json:"company"` 8 | Employees string `json:"employees"` 9 | Reports string `json:"reports"` 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /modules/configurations/entities/module_info.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type ModuleInfo struct { 4 | Id int 5 | Code string 6 | } 7 | 8 | var ( 9 | ModuleAuthentication = ModuleInfo{Code: "authentication"} 10 | ModuleConfigurations = ModuleInfo{Code: "configurations"} 11 | ModuleReferences = ModuleInfo{Code: "references"} 12 | ModuleCompany = ModuleInfo{Code: "company"} 13 | ModuleEmployees = ModuleInfo{Code: "employees"} 14 | ModuleReports = ModuleInfo{Code: "reports"} 15 | ) 16 | 17 | 18 | -------------------------------------------------------------------------------- /modules/configurations/repositories/basic_configuration_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "github.com/ortizdavid/golang-modular-software/database" 5 | "github.com/ortizdavid/golang-modular-software/modules/configurations/entities" 6 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 7 | ) 8 | 9 | type BasicConfigurationRepository struct { 10 | db *database.Database 11 | *shared.BaseRepository[entities.BasicConfiguration] 12 | } 13 | 14 | func NewBasicConfigurationRepository(db *database.Database) *BasicConfigurationRepository { 15 | return &BasicConfigurationRepository{ 16 | db: db, 17 | BaseRepository: shared.NewBaseRepository[entities.BasicConfiguration](db), 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /modules/configurations/repositories/company_configuration_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "github.com/ortizdavid/golang-modular-software/database" 5 | "github.com/ortizdavid/golang-modular-software/modules/configurations/entities" 6 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 7 | ) 8 | 9 | type CompanyConfigurationRepository struct { 10 | db *database.Database 11 | *shared.BaseRepository[entities.CompanyConfiguration] 12 | } 13 | 14 | func NewCompanyConfigurationRepository(db *database.Database) *CompanyConfigurationRepository { 15 | return &CompanyConfigurationRepository{ 16 | db: db, 17 | BaseRepository: shared.NewBaseRepository[entities.CompanyConfiguration](db), 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /modules/configurations/repositories/db_monitor.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "gorm.io/gorm" 8 | ) 9 | 10 | type TableInfo struct { 11 | TableName string `gorm:"column:TABLE_NAME"` 12 | } 13 | 14 | type DBMonitor struct { 15 | db *gorm.DB 16 | } 17 | 18 | func NewDBMonitor(db *gorm.DB) *DBMonitor { 19 | return &DBMonitor{ 20 | db: db, 21 | } 22 | } 23 | 24 | func (monitor *DBMonitor) GetAllDBTables(ctx context.Context) ([]TableInfo, error) { 25 | var tables []TableInfo 26 | result := monitor.db.Raw("SELECT table_name FROM information_schema.tables WHERE table_schema = 'iguana_balancete_bna' AND table_type = 'BASE TABLE'").Scan(&tables) 27 | if result.Error != nil { 28 | return nil, result.Error 29 | } 30 | return tables, nil 31 | } 32 | 33 | func (monitor *DBMonitor) UpdateStatistics(ctx context.Context) { 34 | tables, _ := monitor.GetAllDBTables(ctx) 35 | for _, table := range tables { 36 | result := monitor.db.Exec(" ANALYZE TABLE "+table.TableName+";") 37 | if result.Error != nil { 38 | log.Fatal(result.Error) 39 | break 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /modules/configurations/repositories/email_configuration_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "github.com/ortizdavid/golang-modular-software/database" 5 | "github.com/ortizdavid/golang-modular-software/modules/configurations/entities" 6 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/repositories" 7 | ) 8 | 9 | type EmailConfigurationRepository struct { 10 | db *database.Database 11 | *shared.BaseRepository[entities.EmailConfiguration] 12 | } 13 | 14 | func NewEmailConfigurationRepository(db *database.Database) *EmailConfigurationRepository { 15 | return &EmailConfigurationRepository{ 16 | db: db, 17 | BaseRepository: shared.NewBaseRepository[entities.EmailConfiguration](db), 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /modules/employees/api/helper.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | const ( 4 | infoLogFile = "employees-info.log" 5 | errorLogFile = "employees-error.log" 6 | ) -------------------------------------------------------------------------------- /modules/employees/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewEmployeeApi(db).Routes(router) 10 | } -------------------------------------------------------------------------------- /modules/employees/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | infoLogFile = "employees-info.log" 5 | errorLogFile = "employees-error.log" 6 | ) -------------------------------------------------------------------------------- /modules/employees/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewRootController(db).Routes(router, db) 10 | NewEmployeeController(db).Routes(router, db) 11 | NewJobTitleController(db).Routes(router, db) 12 | NewDocumentTypeController(db).Routes(router, db) 13 | } 14 | -------------------------------------------------------------------------------- /modules/employees/entities/document_type.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type DocumentType struct { 8 | TypeId int `gorm:"autoIncrement;primaryKey"` 9 | TypeName string `gorm:"column:type_name"` 10 | Description string `gorm:"column:description"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (DocumentType) TableName() string { 15 | return "employees.document_types" 16 | } 17 | -------------------------------------------------------------------------------- /modules/employees/entities/employee_account.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type EmployeeAccountData struct { 4 | UserId int16 `json:"user_id"` 5 | UserName string `json:"user_name"` 6 | Email string `json:"email"` 7 | UniqueId string `json:"unique_id"` 8 | CreatedAt string `json:"created_at"` 9 | UpdatedAt string `json:"updated_at"` 10 | EmployeeId int64 `json:"employee_id"` 11 | EmployeeUniqueId string `json:"employee_unique_id"` 12 | FirstName string `json:"first_name"` 13 | LastName string `json:"last_name"` 14 | IdentificationNumber string `json:"identification_number"` 15 | } 16 | -------------------------------------------------------------------------------- /modules/employees/entities/employee_email.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type EmployeeEmail struct { 8 | EmailId int64 `gorm:"autoIncrement;primaryKey"` 9 | EmployeeId int64 `gorm:"column:employee_id"` 10 | ContactTypeId int `gorm:"column:contact_type_id"` 11 | EmailAddress string `gorm:"column:email_address"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (EmployeeEmail) TableName() string { 16 | return "employees.employee_emails" 17 | } 18 | 19 | type EmployeeEmailData struct { 20 | EmailId int64 `json:"email_id"` 21 | EmailAddress string `json:"email_address"` 22 | UniqueId string `json:"unique_id"` 23 | CreatedAt string `json:"created_at"` 24 | UpdatedAt string `json:"updated_at"` 25 | EmployeeId int64 `json:"employee_id"` 26 | EmployeeUniqueId string `json:"employee_unique_id"` 27 | FirstName string `json:"first_name"` 28 | LastName string `json:"last_name"` 29 | ContactTypeId int `json:"contact_type_id"` 30 | ContactTypeName string `json:"contact_type_name"` 31 | } 32 | 33 | -------------------------------------------------------------------------------- /modules/employees/entities/employee_phone.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type EmployeePhone struct { 8 | PhoneId int64 `gorm:"autoIncrement;primaryKey"` 9 | EmployeeId int64 `gorm:"column:employee_id"` 10 | ContactTypeId int `gorm:"column:contact_type_id"` 11 | PhoneNumber string `gorm:"column:phone_number"` 12 | entities.BaseEntity 13 | } 14 | 15 | func (EmployeePhone) TableName() string { 16 | return "employees.employee_phones" 17 | } 18 | 19 | type EmployeePhoneData struct { 20 | PhoneId int64 `json:"phone_id"` 21 | PhoneNumber string `json:"phone_number"` 22 | UniqueId string `json:"unique_id"` 23 | CreatedAt string `json:"created_at"` 24 | UpdatedAt string `json:"updated_at"` 25 | EmployeeId int64 `json:"employee_id"` 26 | EmployeeUniqueId string `json:"employee_unique_id"` 27 | FirstName string `json:"first_name"` 28 | LastName string `json:"last_name"` 29 | ContactTypeId int `json:"contact_type_id"` 30 | ContactTypeName string `json:"contact_type_name"` 31 | } 32 | -------------------------------------------------------------------------------- /modules/employees/entities/job_title.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type JobTitle struct { 8 | JobTitleId int `gorm:"autoIncrement;primaryKey"` 9 | TitleName string `gorm:"column:title_name"` 10 | Description string `gorm:"column:description"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (JobTitle) TableName() string { 15 | return "employees.job_titles" 16 | } 17 | -------------------------------------------------------------------------------- /modules/employees/entities/statistics.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type Statistics struct { 4 | Employees int64 `json:"employees"` 5 | JobTitles int64 `json:"job_titles"` 6 | DocumentTypes int64 `json:"document_types"` 7 | } -------------------------------------------------------------------------------- /modules/employees/repositories/statistics_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/employees/entities" 8 | ) 9 | 10 | type StatisticsRepository struct { 11 | db *database.Database 12 | } 13 | 14 | func NewStatisticsRepository(db *database.Database) *StatisticsRepository { 15 | return &StatisticsRepository{ 16 | db: db, 17 | } 18 | } 19 | 20 | func (repo *StatisticsRepository) GetStatistics(ctx context.Context) (entities.Statistics, error) { 21 | var statistics entities.Statistics 22 | result := repo.db.WithContext(ctx).Raw("SELECT * FROM employees.view_statistics_data;").Scan(&statistics) 23 | return statistics, result.Error 24 | } 25 | -------------------------------------------------------------------------------- /modules/employees/services/employee_service_get_one.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/common/apperrors" 7 | "github.com/ortizdavid/golang-modular-software/modules/employees/entities" 8 | ) 9 | 10 | func (s *EmployeeService) GetByUniqueId(ctx context.Context, uniqueId string) (entities.EmployeeData, error) { 11 | employee, err := s.repository.GetDataByUniqueId(ctx, uniqueId) 12 | if err != nil { 13 | return entities.EmployeeData{}, apperrors.NotFoundError("employee not found") 14 | } 15 | if employee.EmployeeId == 0 { 16 | return entities.EmployeeData{}, apperrors.NotFoundError("employee not found") 17 | } 18 | return employee, nil 19 | } 20 | 21 | func (s *EmployeeService) GetByIdentificationNumber(ctx context.Context, identNumber string) (entities.EmployeeData, error) { 22 | employee, err := s.repository.GetDataByIdentificationNumber(ctx, identNumber) 23 | if err != nil { 24 | return entities.EmployeeData{}, apperrors.NotFoundError("employee not found") 25 | } 26 | if employee.EmployeeId == 0 { 27 | return entities.EmployeeData{}, apperrors.NotFoundError("employee not found") 28 | } 29 | return employee, nil 30 | } 31 | -------------------------------------------------------------------------------- /modules/employees/services/statistics_service.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/employees/repositories" 8 | "github.com/ortizdavid/golang-modular-software/modules/employees/entities" 9 | ) 10 | 11 | type StatisticsService struct { 12 | repository *repositories.StatisticsRepository 13 | } 14 | 15 | func NewStatisticsService(db *database.Database) *StatisticsService { 16 | return &StatisticsService{ 17 | repository: repositories.NewStatisticsRepository(db), 18 | } 19 | } 20 | 21 | func (s *StatisticsService) GetStatistics(ctx context.Context) (entities.Statistics, error) { 22 | statistics, err := s.repository.GetStatistics(ctx) 23 | if err != nil { 24 | return entities.Statistics{}, err 25 | } 26 | return statistics, nil 27 | } 28 | -------------------------------------------------------------------------------- /modules/references/api/helper.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | const ( 4 | infoLogFile = "references-info.log" 5 | errorLogFile = "references-error.log" 6 | ) -------------------------------------------------------------------------------- /modules/references/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterApiRoutes(router *fiber.App, db *database.Database) { 9 | NewCountryApi(db).Routes(router, db) 10 | NewCurrencyApi(db).Routes(router, db) 11 | NewIdentificationTypeApi(db).Routes(router, db) 12 | NewContactTypeApi(db).Routes(router, db) 13 | NewMaritalStatusApi(db).Routes(router, db) 14 | NewTaskStatusApi(db).Routes(router, db) 15 | NewApprovalStatusApi(db).Routes(router, db) 16 | NewDocumentStatusApi(db).Routes(router, db) 17 | NewWorkflowStatusApi(db).Routes(router, db) 18 | NewEmploymentStatusApi(db).Routes(router, db) 19 | } -------------------------------------------------------------------------------- /modules/references/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | infoLogFile = "references-info.log" 5 | errorLogFile = "references-error.log" 6 | ) -------------------------------------------------------------------------------- /modules/references/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewRootController(db).Routes(router, db) 10 | NewCountryController(db).Routes(router, db) 11 | NewCurrencyController(db).Routes(router, db) 12 | NewTaskStatusController(db).Routes(router, db) 13 | NewApprovalStatusController(db).Routes(router, db) 14 | NewWorkflowStatusController(db).Routes(router, db) 15 | NewEvaluationStatusController(db).Routes(router, db) 16 | NewUserStatusController(db).Routes(router, db) 17 | NewEmploymentStatusController(db).Routes(router, db) 18 | NewDocumentStatusController(db).Routes(router, db) 19 | NewMaritalStatusController(db).Routes(router, db) 20 | NewContactTypeController(db).Routes(router, db) 21 | NewIdentificationTypeController(db).Routes(router, db) 22 | } 23 | -------------------------------------------------------------------------------- /modules/references/entities/approval_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type ApprovalStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (ApprovalStatus) TableName() string { 18 | return "reference.approval_statuses" 19 | } 20 | -------------------------------------------------------------------------------- /modules/references/entities/contact_type.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type ContactType struct { 8 | TypeId int `gorm:"autoIncrement;primaryKey" json:"type_id"` 9 | TypeName string `gorm:"column:type_name" json:"type_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (ContactType) TableName() string { 15 | return "reference.contact_types" 16 | } 17 | -------------------------------------------------------------------------------- /modules/references/entities/country.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Country struct { 8 | CountryId int `gorm:"autoIncrement;primaryKey" json:"country_id"` 9 | CountryName string `gorm:"column:country_name" json:"country_name"` 10 | IsoCode string `gorm:"column:iso_code" json:"iso_code"` 11 | DialingCode string `gorm:"column:dialing_code" json:"dialing_code"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (Country) TableName() string { 16 | return "reference.countries" 17 | } 18 | 19 | type CountryData struct { 20 | CountryId int `json:"country_id"` 21 | UniqueId string `json:"unique_id"` 22 | CountryName string `json:"country_name"` 23 | IsoCode string `json:"iso_code"` 24 | IsoCodeLower string `json:"iso_code_lower"` 25 | DialingCode string `json:"dialing_code"` 26 | CreatedAt string `json:"created_at"` 27 | UpdatedAt string `json:"updated_at"` 28 | } 29 | -------------------------------------------------------------------------------- /modules/references/entities/currency.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type Currency struct { 8 | CurrencyId int `gorm:"autoIncrement;primaryKey" json:"currency_id"` 9 | CurrencyName string `gorm:"column:currency_name" json:"currency_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | Symbol string `gorm:"column:symbol" json:"symbol"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (Currency) TableName() string { 16 | return "reference.currencies" 17 | } 18 | -------------------------------------------------------------------------------- /modules/references/entities/document_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type DocumentStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (DocumentStatus) TableName() string { 18 | return "reference.document_statuses" 19 | } 20 | -------------------------------------------------------------------------------- /modules/references/entities/employment_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type EmploymentStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | Description string `gorm:"column:description" json:"description"` 12 | shared.BaseEntity 13 | } 14 | 15 | func (EmploymentStatus) TableName() string { 16 | return "reference.employment_statuses" 17 | } 18 | -------------------------------------------------------------------------------- /modules/references/entities/evaluation_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type EvaluationStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | Weight int `gorm:"column:weight"` 15 | shared.BaseEntity 16 | } 17 | 18 | func (EvaluationStatus) TableName() string { 19 | return "reference.evaluation_statuses" 20 | } 21 | -------------------------------------------------------------------------------- /modules/references/entities/identification_type.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type IdentificationType struct { 8 | TypeId int `gorm:"autoIncrement;primaryKey" json:"type_id"` 9 | TypeName string `gorm:"column:type_name" json:"type_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (IdentificationType) TableName() string { 15 | return "reference.identification_types" 16 | } 17 | -------------------------------------------------------------------------------- /modules/references/entities/marital_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type MaritalStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | shared.BaseEntity 12 | } 13 | 14 | func (MaritalStatus) TableName() string { 15 | return "reference.marital_statuses" 16 | } 17 | -------------------------------------------------------------------------------- /modules/references/entities/statistics.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type Statistics struct { 4 | Countries int64 `json:"countries"` 5 | Currencies int64 `json:"currencies"` 6 | IdentificationTypes int64 `json:"identification_types"` 7 | ContactTypes int64 `json:"contact_types"` 8 | MaritalStatuses int64 `json:"marital_statuses"` 9 | TaskStatuses int64 `json:"task_statuses"` 10 | ApprovalStatuses int64 `json:"approval_statuses"` 11 | DocumentStatuses int64 `json:"document_statuses"` 12 | WorkflowStatuses int64 `json:"workflow_statuses"` 13 | EvaluationStatuses int64 `json:"evaluation_statuses"` 14 | UserStatuses int64 `json:"user_statuses"` 15 | EmploymentStatuses int64 `json:"employment_statuses"` 16 | } 17 | -------------------------------------------------------------------------------- /modules/references/entities/task_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type TaskStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (TaskStatus) TableName() string { 18 | return "reference.task_statuses" 19 | } 20 | -------------------------------------------------------------------------------- /modules/references/entities/user_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type UserStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (UserStatus) TableName() string { 18 | return "reference.user_statuses" 19 | } 20 | -------------------------------------------------------------------------------- /modules/references/entities/workflow_status.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | shared "github.com/ortizdavid/golang-modular-software/modules/shared/entities" 5 | ) 6 | 7 | type WorkflowStatus struct { 8 | StatusId int `gorm:"autoIncrement;primaryKey" json:"status_id"` 9 | StatusName string `gorm:"column:status_name" json:"status_name"` 10 | Code string `gorm:"column:code" json:"code"` 11 | LblColor string `gorm:"column:lbl_color" json:"lbl_color"` 12 | BgColor string `gorm:"column:bg_color" json:"bg_color"` 13 | Description string `gorm:"column:description" json:"description"` 14 | shared.BaseEntity 15 | } 16 | 17 | func (WorkflowStatus) TableName() string { 18 | return "reference.workflow_statuses" 19 | } 20 | -------------------------------------------------------------------------------- /modules/references/repositories/statistics_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/references/entities" 8 | ) 9 | 10 | type StatisticsRepository struct { 11 | db *database.Database 12 | } 13 | 14 | func NewStatisticsRepository(db *database.Database) *StatisticsRepository { 15 | return &StatisticsRepository{ 16 | db: db, 17 | } 18 | } 19 | 20 | func (repo *StatisticsRepository) GetStatistics(ctx context.Context) (entities.Statistics, error) { 21 | var statistics entities.Statistics 22 | result := repo.db.WithContext(ctx).Raw("SELECT * FROM reference.view_statistics_data;").Scan(&statistics) 23 | return statistics, result.Error 24 | } 25 | -------------------------------------------------------------------------------- /modules/references/services/statistics_service.go: -------------------------------------------------------------------------------- 1 | package services 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/ortizdavid/golang-modular-software/database" 7 | "github.com/ortizdavid/golang-modular-software/modules/references/entities" 8 | "github.com/ortizdavid/golang-modular-software/modules/references/repositories" 9 | ) 10 | 11 | type StatisticsService struct { 12 | repository *repositories.StatisticsRepository 13 | } 14 | 15 | func NewStatisticsService(db *database.Database) *StatisticsService { 16 | return &StatisticsService{ 17 | repository: repositories.NewStatisticsRepository(db), 18 | } 19 | } 20 | 21 | func (s *StatisticsService) GetStatistics(ctx context.Context) (entities.Statistics, error) { 22 | statistics, err := s.repository.GetStatistics(ctx) 23 | if err != nil { 24 | return entities.Statistics{}, err 25 | } 26 | return statistics, nil 27 | } 28 | -------------------------------------------------------------------------------- /modules/reports/api/routes.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | } -------------------------------------------------------------------------------- /modules/reports/controllers/helper.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const( 4 | infoLogFile = "reports-info.log" 5 | errorLogFile = "reports-error.log" 6 | ) -------------------------------------------------------------------------------- /modules/reports/controllers/routes.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | func RegisterRoutes(router *fiber.App, db *database.Database) { 9 | NewRootController(db).Routes(router, db) 10 | NewUserReportController(db).Routes(router, db) 11 | NewConfigurationReportController(db).Routes(router, db) 12 | NewCompanyReportController(db).Routes(router, db) 13 | NewEmployeeReportController(db).Routes(router, db) 14 | } 15 | -------------------------------------------------------------------------------- /modules/reports/module_routes.go: -------------------------------------------------------------------------------- 1 | package reports 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | "github.com/ortizdavid/golang-modular-software/modules/reports/api" 7 | "github.com/ortizdavid/golang-modular-software/modules/reports/controllers" 8 | ) 9 | 10 | func RegisterModuleRoutes(router *fiber.App, db *database.Database) { 11 | controllers.RegisterRoutes(router, db) 12 | api.RegisterRoutes(router, db) 13 | } -------------------------------------------------------------------------------- /modules/shared/controllers/controller.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | type Controller interface { 9 | Routes(router *fiber.App, db *database.Database) 10 | index(fiber.Ctx) error 11 | details(fiber.Ctx) error 12 | createForm(fiber.Ctx) error 13 | create(fiber.Ctx) error 14 | editForm(fiber.Ctx) error 15 | edit(fiber.Ctx) error 16 | searchForm(fiber.Ctx) error 17 | search(fiber.Ctx) error 18 | } 19 | -------------------------------------------------------------------------------- /modules/shared/entities/base_entity.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import "time" 4 | 5 | type BaseEntity struct { 6 | UniqueId string `gorm:"column:unique_id" json:"unique_id"` 7 | CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` 8 | UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` 9 | } 10 | -------------------------------------------------------------------------------- /modules/shared/entities/entity.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type Entity interface { 4 | TableName() string 5 | } -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_aux.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | // SetLastInsertId sets the last inserted ID safely with a mutex. 4 | func (repo *BaseRepository[T]) SetLastInsertId(id int64) { 5 | repo.mu.Lock() 6 | defer repo.mu.Unlock() 7 | repo.lastInsertId = id 8 | } 9 | 10 | // GetLastInsertId retrieves the last inserted ID safely with a mutex. 11 | func (repo *BaseRepository[T]) GetLastInsertId() int64 { 12 | repo.mu.Lock() 13 | defer repo.mu.Unlock() 14 | return repo.lastInsertId 15 | } 16 | 17 | // setAffectedRows sets the number of affected rows safely with a mutex. 18 | func (repo *BaseRepository[T]) setAffectedRows(rows int64) { 19 | repo.mu.Lock() 20 | defer repo.mu.Unlock() 21 | repo.affectedRows = rows 22 | } 23 | 24 | // GetAffectedRows retrieves the number of affected rows safely with a mutex. 25 | func (repo *BaseRepository[T]) GetAffectedRows() int64 { 26 | repo.mu.Lock() 27 | defer repo.mu.Unlock() 28 | return repo.affectedRows 29 | } 30 | -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_count.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import "context" 4 | 5 | // Count retrieves the total number of entities in the database. 6 | func (repo *BaseRepository[T]) Count(ctx context.Context) (int64, error) { 7 | var count int64 8 | var entity T 9 | result := repo.db.WithContext(ctx).Model(&entity).Count(&count) 10 | return count, result.Error 11 | } 12 | 13 | // CountWhere retrieves the count of entities that match a specific field and value. 14 | func (repo *BaseRepository[T]) CountWhere(ctx context.Context, field string, value interface{}) (int64, error) { 15 | var count int64 16 | var entity T 17 | result := repo.db.WithContext(ctx).Model(&entity).Where(field+" = ?", value).Count(&count) 18 | return count, result.Error 19 | } -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_deletion.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import "context" 4 | 5 | // DeleteById deletes an entity from the database using its primary key or unique identifier. 6 | func (repo *BaseRepository[T]) DeleteByUniqueId(ctx context.Context, uniqueId string) error { 7 | var entity T 8 | result := repo.db.WithContext(ctx).Where("unique_id = ?", uniqueId).Delete(&entity) 9 | return result.Error 10 | } 11 | 12 | // DeleteByUniqueId deletes an entity from the database using its unique_id field. 13 | func (repo *BaseRepository[T]) DeleteById(ctx context.Context, id interface{}) error { 14 | var entity T 15 | result := repo.db.WithContext(ctx).First(&entity, id).Delete(&entity) 16 | return result.Error 17 | } 18 | 19 | // DeleteWhere deletes an entity from the database based on a specified field and its value. 20 | func (repo *BaseRepository[T]) DeleteWhere(ctx context.Context, field string, value interface{}) error { 21 | var entity T 22 | result := repo.db.WithContext(ctx).Where(field+" = ?", value).Delete(&entity) 23 | return result.Error 24 | } 25 | -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_exists.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import "context" 4 | 5 | // ExistsField checks if an entity with a specific field value exists. 6 | func (repo *BaseRepository[T]) ExistsField(ctx context.Context, field string, value interface{}) (bool, error) { 7 | var count int64 8 | var entity T 9 | result := repo.db.WithContext(ctx).Model(&entity).Where(field+" = ?", value).Count(&count) 10 | if result.Error != nil { 11 | return false, result.Error 12 | } 13 | repo.setAffectedRows(result.RowsAffected) 14 | return count > 0, nil 15 | } 16 | -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_transaction.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "context" 5 | "github.com/ortizdavid/golang-modular-software/database" 6 | ) 7 | 8 | // WithTransaction executes the provided function within a transaction. 9 | // This method can be used in services and other packages that require transactional integrity 10 | func (repo *BaseRepository[T]) WithTransaction(ctx context.Context, fn func(tx *database.Database) error) error { 11 | return repo.db.WithTx(ctx, fn) 12 | } 13 | -------------------------------------------------------------------------------- /modules/shared/repositories/base_repository_update.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import "context" 4 | 5 | // UpdateWhere Updates an entity from the database based on a specified field and its value. 6 | func (repo *BaseRepository[T]) UpdateWhere(ctx context.Context, field string, value interface{}, updates map[string]interface{}) error { 7 | var entity T 8 | result := repo.db.WithContext(ctx).Model(&entity).Where(field+" = ?", value).Updates(updates) 9 | repo.setAffectedRows(result.RowsAffected) 10 | return result.Error 11 | } 12 | -------------------------------------------------------------------------------- /public/static/css/auth-style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #F5F5F5; 3 | } 4 | body > .grid { 5 | height: 100%; 6 | } 7 | .image { 8 | margin-top: -100px; 9 | } 10 | .column { 11 | max-width: 450px; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /public/static/css/report-style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif; 3 | } 4 | 5 | table { 6 | border-collapse: collapse; 7 | border-spacing: 0; 8 | } 9 | 10 | .table-report { 11 | width: 100%; 12 | } -------------------------------------------------------------------------------- /public/static/css/style.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,OAAO,CAAC,6EAAI;AAEZ,AAAA,KAAK,CAAC;EACJ,QAAQ,CAAA,MAAC;EACT,cAAc,CAAA,MAAC;EACf,cAAc,CAAA,OAAC;EACf,aAAa,CAAA,wBAAC;CACf;;AACD,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,kBAAkB,CAAC,UAAU;CAC3C;;AACD,AAAA,IAAI,CAAC,mBAAmB,CAAC;EACvB,KAAK,EAAE,GAAG;CACX;;AACD,AAAA,GAAG,AAAA,SAAS,AAAA,KAAK,AAAA,aAAa,CAAC;EAC7B,UAAU,EAAE,eAAe;EAC3B,UAAU,EAAE,iBAAiB,CAAC,UAAU;EACxC,MAAM,EAAE,iBAAiB,CAAC,UAAU;CACrC;;AACD,AAAA,GAAG,AAAA,SAAS,AAAA,KAAK,AAAA,aAAa,CAAC,KAAK,CAAC,CAAC,AAAA,KAAK,CAAC;EAC1C,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,iBAAiB;CAC1B;;AACD,AAAA,aAAa,CAAC;EACZ,UAAU,EAAE,IAAI;CACjB;;AACD,MAAM,EAAE,SAAS,EAAE,KAAK;EACtB,AAAA,GAAG,AAAA,SAAS,AAAA,KAAK,AAAA,aAAa,CAAC;IAC7B,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,oBAAoB;IAC/B,KAAK,EAAE,gBAAgB;GACxB;EACD,AAAA,aAAa,CAAC;IACZ,WAAW,EAAE,KAAK;GACnB;EACD,AAAA,qBAAqB,CAAC;IACpB,OAAO,EAAE,eAAe;GACzB", 4 | "sources": [ 5 | "../scss/style.scss" 6 | ], 7 | "names": [], 8 | "file": "style.css" 9 | } -------------------------------------------------------------------------------- /public/static/css/validation-style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/css/validation-style.css -------------------------------------------------------------------------------- /public/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/images/logo.png -------------------------------------------------------------------------------- /public/static/images/user-blank.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/images/user-blank.jpg -------------------------------------------------------------------------------- /public/static/js/auth-script.js: -------------------------------------------------------------------------------- 1 | $(document) 2 | .ready(function() { 3 | $('.ui.form') 4 | .form({ 5 | fields: { 6 | email: { 7 | identifier : 'email', 8 | rules: [ 9 | { 10 | type : 'empty', 11 | prompt : 'Please enter your e-mail' 12 | }, 13 | { 14 | type : 'email', 15 | prompt : 'Please enter a valid e-mail' 16 | } 17 | ] 18 | }, 19 | password: { 20 | identifier : 'password', 21 | rules: [ 22 | { 23 | type : 'empty', 24 | prompt : 'Please enter your password' 25 | }, 26 | { 27 | type : 'length[6]', 28 | prompt : 'Your password must be at least 6 characters' 29 | } 30 | ] 31 | } 32 | } 33 | }) 34 | ; 35 | }) 36 | ; -------------------------------------------------------------------------------- /public/static/js/dashboard.js: -------------------------------------------------------------------------------- 1 | /* globals Chart:false, feather:false */ 2 | 3 | (() => { 4 | 'use strict' 5 | 6 | feather.replace({ 'aria-hidden': 'true' }) 7 | 8 | // Graphs 9 | const ctx = document.getElementById('myChart') 10 | // eslint-disable-next-line no-unused-vars 11 | const myChart = new Chart(ctx, { 12 | type: 'line', 13 | data: { 14 | labels: [ 15 | 'Sunday', 16 | 'Monday', 17 | 'Tuesday', 18 | 'Wednesday', 19 | 'Thursday', 20 | 'Friday', 21 | 'Saturday' 22 | ], 23 | datasets: [{ 24 | data: [ 25 | 15339, 26 | 21345, 27 | 18483, 28 | 24003, 29 | 23489, 30 | 24092, 31 | 12034 32 | ], 33 | lineTension: 0, 34 | backgroundColor: 'transparent', 35 | borderColor: '#007bff', 36 | borderWidth: 4, 37 | pointBackgroundColor: '#007bff' 38 | }] 39 | }, 40 | options: { 41 | scales: { 42 | yAxes: [{ 43 | ticks: { 44 | beginAtZero: false 45 | } 46 | }] 47 | }, 48 | legend: { 49 | display: false 50 | } 51 | } 52 | }) 53 | })() 54 | -------------------------------------------------------------------------------- /public/static/js/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('.ui.dropdown').dropdown(); 3 | $('.sidebar-menu-toggler').on('click', function() { 4 | var target = $(this).data('target'); 5 | $(target) 6 | .sidebar({ 7 | dinPage: true, 8 | transition: 'overlay', 9 | mobileTransition: 'overlay' 10 | }) 11 | .sidebar('toggle'); 12 | }); 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/.versions: -------------------------------------------------------------------------------- 1 | jquery@1.11.3_2 2 | meteor@1.1.6 3 | semantic:ui-css@2.0.7 4 | underscore@1.0.3 5 | -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Semantic Org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/README.md: -------------------------------------------------------------------------------- 1 | # CSS Distribution 2 | 3 | This repository is automatically synced with the main [Semantic UI](https://github.com/Semantic-Org/Semantic-UI) repository to provide lightweight CSS only version of Semantic UI. 4 | 5 | This package **does not support theming** and includes generated CSS files of the default theme only. 6 | 7 | You can view more on Semantic UI at [LearnSemantic.com](http://www.learnsemantic.com) and [Semantic-UI.com](http://www.semantic-ui.com) 8 | -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/components/breadcrumb.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * # Semantic UI 2.5.0 - Breadcrumb 3 | * http://github.com/semantic-org/semantic-ui/ 4 | * 5 | * 6 | * Released under the MIT license 7 | * http://opensource.org/licenses/MIT 8 | * 9 | */.ui.breadcrumb{line-height:1;display:inline-block;margin:0 0;vertical-align:middle}.ui.breadcrumb:first-child{margin-top:0}.ui.breadcrumb:last-child{margin-bottom:0}.ui.breadcrumb .divider{display:inline-block;opacity:.7;margin:0 .21428571rem 0;font-size:.92857143em;color:rgba(0,0,0,.4);vertical-align:baseline}.ui.breadcrumb a{color:#4183c4}.ui.breadcrumb a:hover{color:#1e70bf}.ui.breadcrumb .icon.divider{font-size:.85714286em;vertical-align:baseline}.ui.breadcrumb a.section{cursor:pointer}.ui.breadcrumb .section{display:inline-block;margin:0;padding:0}.ui.breadcrumb.segment{display:inline-block;padding:.78571429em 1em}.ui.breadcrumb .active.section{font-weight:700}.ui.mini.breadcrumb{font-size:.78571429rem}.ui.tiny.breadcrumb{font-size:.85714286rem}.ui.small.breadcrumb{font-size:.92857143rem}.ui.breadcrumb{font-size:1rem}.ui.large.breadcrumb{font-size:1.14285714rem}.ui.big.breadcrumb{font-size:1.28571429rem}.ui.huge.breadcrumb{font-size:1.42857143rem}.ui.massive.breadcrumb{font-size:1.71428571rem} -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/components/sticky.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * # Semantic UI 2.5.0 - Sticky 3 | * http://github.com/semantic-org/semantic-ui/ 4 | * 5 | * 6 | * Released under the MIT license 7 | * http://opensource.org/licenses/MIT 8 | * 9 | */.ui.sticky{position:static;transition:none;z-index:800}.ui.sticky.bound{position:absolute;left:auto;right:auto}.ui.sticky.fixed{position:fixed;left:auto;right:auto}.ui.sticky.bound.top,.ui.sticky.fixed.top{top:0;bottom:auto}.ui.sticky.bound.bottom,.ui.sticky.fixed.bottom{top:auto;bottom:0}.ui.native.sticky{position:-webkit-sticky;position:-moz-sticky;position:-ms-sticky;position:-o-sticky;position:sticky} -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/components/tab.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * # Semantic UI 2.5.0 - Tab 3 | * http://github.com/semantic-org/semantic-ui/ 4 | * 5 | * 6 | * Released under the MIT license 7 | * http://opensource.org/licenses/MIT 8 | * 9 | */.ui.tab{display:none}.ui.tab.active,.ui.tab.open{display:block}.ui.tab.loading{position:relative;overflow:hidden;display:block;min-height:250px}.ui.tab.loading *{position:relative!important;left:-10000px!important}.ui.tab.loading.segment:before,.ui.tab.loading:before{position:absolute;content:'';top:100px;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;border-radius:500rem;border:.2em solid rgba(0,0,0,.1)}.ui.tab.loading.segment:after,.ui.tab.loading:after{position:absolute;content:'';top:100px;left:50%;margin:-1.25em 0 0 -1.25em;width:2.5em;height:2.5em;-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 transparent transparent;border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent} -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/package.js: -------------------------------------------------------------------------------- 1 | var 2 | where = 'client' // Adds files only to the client 3 | ; 4 | 5 | Package.describe({ 6 | name : 'semantic:ui-css', 7 | summary : 'Semantic UI - CSS Release of Semantic UI', 8 | version : '2.5.0', 9 | git : 'git://github.com/Semantic-Org/Semantic-UI-CSS.git', 10 | }); 11 | 12 | Package.onUse(function(api) { 13 | 14 | api.versionsFrom('1.0'); 15 | 16 | api.use('jquery', 'client'); 17 | 18 | api.addAssets([ 19 | // icons 20 | 'themes/default/assets/fonts/icons.eot', 21 | 'themes/default/assets/fonts/icons.svg', 22 | 'themes/default/assets/fonts/icons.ttf', 23 | 'themes/default/assets/fonts/icons.woff', 24 | 'themes/default/assets/fonts/icons.woff2', 25 | 26 | // flags 27 | 'themes/default/assets/images/flags.png' 28 | ], 'client'); 29 | 30 | api.addFiles([ 31 | // release 32 | 'semantic.css', 33 | 'semantic.js' 34 | ], 'client'); 35 | 36 | }); 37 | -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.eot -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.ttf -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.woff -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/brand-icons.woff2 -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/icons.eot -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/icons.otf -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/icons.ttf -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/icons.woff -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/icons.woff2 -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.eot -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.ttf -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.woff -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/fonts/outline-icons.woff2 -------------------------------------------------------------------------------- /public/static/lib/semantic-ui/themes/default/assets/images/flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/static/lib/semantic-ui/themes/default/assets/images/flags.png -------------------------------------------------------------------------------- /public/static/scss/style.scss: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap'); 2 | 3 | :root { 4 | --tablet: 768px; 5 | --smallMonitor: 992px; 6 | --largeMonitor: 1200px; 7 | --font-family: 'Open Sans', sans-serif; 8 | } 9 | body { 10 | font-family: var(--font-family) !important; 11 | } 12 | body ::-webkit-scrollbar { 13 | width: 6px; 14 | } 15 | .ui.vertical.menu.sidebar-menu { 16 | margin-top: 40px !important; 17 | max-height: calc(100% - 40px) !important; 18 | height: calc(100% - 40px) !important; 19 | } 20 | .ui.vertical.menu.sidebar-menu .item i.icon { 21 | float: left; 22 | margin: 0em 0.5em 0em 0em; 23 | } 24 | .main-content { 25 | margin-top: 40px; 26 | } 27 | @media (min-width: 768px) { 28 | .ui.vertical.menu.sidebar-menu { 29 | visibility: visible; 30 | transform: translate3d(0, 0, 0); 31 | width: 15rem !important; 32 | } 33 | .main-content { 34 | margin-left: 15rem; 35 | } 36 | .sidebar-menu-toggler { 37 | display: none !important; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /public/templates/_back_office/api-root.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{.Title}} 7 | 8 | 9 | 10 |
11 |

12 |

Golang Modular Software API

13 | 14 |
15 |

API Collection Download

16 |
17 |

To simplify testing and interaction with the Golang Modular Software API, we’ve prepared an API collection compatible with Postman.

18 |

Download the collection by clicking the link below:

19 | Download API Collection 20 |

Once downloaded, you can import the collection into Postman and start testing the endpoints immediately.

21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /public/templates/_back_office/notifications.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | 4 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/_errors/authentication.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-auth" .}} 2 | 3 |
4 |
5 | {{.Title}} 6 |
7 |

Access restricted. Please log in to continue.

8 |
9 | 10 | {{ template "_partials/footer-auth" .}} 11 | -------------------------------------------------------------------------------- /public/templates/_errors/authorization.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 | {{.Title}}: {{.Message}} 6 |
7 |

Go back to the previous page.

8 |
9 | 10 | {{ template "_partials/footer-back" .}} 11 | -------------------------------------------------------------------------------- /public/templates/_errors/error.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 | {{.Title}} 6 |
7 |
8 | {{.Message}} 9 |
10 |

Go back to the previous page.

11 |
12 | 13 | {{ template "_partials/footer-back" .}} 14 | -------------------------------------------------------------------------------- /public/templates/_partials/footer-auth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/templates/_partials/footer-back.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/templates/_partials/header-auth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{.Title}} 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |

16 | 17 |
18 | {{.Title}} 19 |
20 |

21 | -------------------------------------------------------------------------------- /public/templates/authentication/account/change-data.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | 4 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/authentication/account/upload-image.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 18 |
19 | 20 | 21 | Cancel 22 | 23 |
24 |
25 |
26 | 27 | {{ template "_partials/footer-back" .}} 28 | -------------------------------------------------------------------------------- /public/templates/authentication/auth/get-recover-link.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-auth" .}} 2 | 3 | 18 | 19 |
20 | Did you get recovery link? Click Here 21 |
22 | 23 | {{ template "_partials/footer-auth" .}} -------------------------------------------------------------------------------- /public/templates/authentication/login-activity/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/authentication/permission/delete.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/authentication/permission/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 18 |

ID: {{.Permission.PermissionId}}

19 |

Permission Name: {{.Permission.PermissionName}}

20 |

Code: {{.Permission.Code}}

21 |

Description: {{.Permission.Description}}

22 |

Creation Date: {{.Permission.CreatedAt}}

23 |

Last Update: {{.Permission.UpdatedAt}}

24 |
25 | 26 | {{ template "_partials/footer-back" .}} 27 | -------------------------------------------------------------------------------- /public/templates/authentication/permission/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/authentication/role/delete.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/authentication/role/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/authentication/user/activate.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 5 |
6 |
7 | 8 | 9 |
10 |
11 | 15 |
16 | 17 | 18 | Cancel 19 | 20 |
21 |
22 |
23 | 24 | {{ template "_partials/footer-back" .}} 25 | -------------------------------------------------------------------------------- /public/templates/authentication/user/deactivate.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/authentication/user/details-api-info.html: -------------------------------------------------------------------------------- 1 |

X User ID: {{.UserApiKey.XUserId}}

2 |

X API Key: {{.UserApiKey.XApiKey}}

3 |

Expiration Date: {{.UserApiKey.ExpiresAt}}

4 |

Is Active: {{.UserApiKey.IsActive}}

-------------------------------------------------------------------------------- /public/templates/authentication/user/details-status-activity.html: -------------------------------------------------------------------------------- 1 |

Status: {{.LoginActivity.Status}}

2 |

Device: {{.LoginActivity.Device}}

3 |

Browser: {{.LoginActivity.Browser}}

4 |

Last Login: {{.LoginActivity.LastLogin}}

5 |

Last Logout: {{.LoginActivity.LastLogout}}

6 |

Total Login: {{.LoginActivity.TotalLogin}}

7 |

Total Logout: {{.LoginActivity.TotalLogout}}

-------------------------------------------------------------------------------- /public/templates/authentication/user/details-user-info.html: -------------------------------------------------------------------------------- 1 |
2 | {{ if .User.UserImage}} 3 | User Image 4 | {{ else }} 5 | Default User Image 6 | {{ end }} 7 |
8 |
9 |

ID: {{.User.UserId}}

10 |

User Name: {{.User.UserName}}

11 |

Email: {{.User.Email}}

12 |

Active Status: 13 | 14 | {{ if eq .User.IsActive "Yes" }}Active{{ else }}Inactive{{ end }} 15 | 16 |

17 |

Creation Date: {{.User.CreatedAt}}

18 |

Last Update: {{.User.UpdatedAt}}

-------------------------------------------------------------------------------- /public/templates/authentication/user/edit.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/authentication/user/remove-role.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 18 |
19 | 20 | 21 | Cancel 22 | 23 |
24 |
25 |
26 | 27 | {{ template "_partials/footer-back" .}} 28 | -------------------------------------------------------------------------------- /public/templates/authentication/user/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/branch/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.Branch.BranchId}}

15 |

Branch Name: {{.Branch.BranchName}}

16 |

Code: {{.Branch.Code}}

17 |

Address: {{.Branch.Address}}

18 |

Phone: {{.Branch.Phone}}

19 |

Email: {{.Branch.Email}}

20 |

Creation Date: {{.Branch.CreatedAt}}

21 |

Last Update: {{.Branch.UpdatedAt}}

22 |
23 | 24 | {{ template "_partials/footer-back" .}} 25 | -------------------------------------------------------------------------------- /public/templates/company/branch/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/department/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.Department.DepartmentId}}

15 |

Department Name: {{.Department.DepartmentName}}

16 |

Acronym: {{.Department.Acronym}}

17 |

Description: {{.Department.Description}}

18 |

Creation Date: {{.Department.CreatedAt}}

19 |

Last Update: {{.Department.UpdatedAt}}

20 |
21 | 22 | {{ template "_partials/footer-back" .}} 23 | -------------------------------------------------------------------------------- /public/templates/company/department/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/office/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.Office.OfficeId}}

15 |

Office Name: {{.Office.OfficeName}}

16 |

Code: {{.Office.Code}}

17 |

Address: {{.Office.Address}}

18 |

Phone: {{.Office.Phone}}

19 |

Email: {{.Office.Email}}

20 |

Creation Date: {{.Office.CreatedAt}}

21 |

Last Update: {{.Office.UpdatedAt}}

22 |
23 | 24 | {{ template "_partials/footer-back" .}} 25 | -------------------------------------------------------------------------------- /public/templates/company/office/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/policy/delete-attachment.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/company/policy/delete.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/company/policy/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/project/delete-attachment.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/company/project/delete.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 14 |
15 | 16 | 17 | Cancel 18 | 19 |
20 |
21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/company/project/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/company/room/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.Room.RoomId}}

15 |

Room Name: {{.Room.RoomName}}

16 |

Number: {{.Room.Number}}

17 |

Capacity: {{.Room.Capacity}}

18 |

Branch: {{.Room.BranchName}}

19 |

Creation Date: {{.Room.CreatedAt}}

20 |

Last Update: {{.Room.UpdatedAt}}

21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/company/room/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/configuration/basic/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 10 |

ID: {{.AppConfig.BasicConfig.ConfigurationId}}

11 |

App Name: {{.AppConfig.BasicConfig.AppName}}

12 |

App Acronym: {{.AppConfig.BasicConfig.AppAcronym}}

13 |

Max Records Per Page: {{.AppConfig.BasicConfig.MaxRecordsPerPage}}

14 |

Max Admin Users: {{.AppConfig.BasicConfig.MaxAdmninUsers}}

15 |

Max Super Admin Users: {{.AppConfig.BasicConfig.MaxSuperAdmninUsers}}

16 |

Creation Date: {{.AppConfig.BasicConfig.CreatedAt}}

17 |

Last Update: {{.AppConfig.BasicConfig.UpdatedAt}}

18 |
19 | 20 | {{ template "_partials/footer-back" .}} 21 | -------------------------------------------------------------------------------- /public/templates/configuration/company/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 10 |
11 | Company Logo 12 |
13 |

ID: {{.AppConfig.CompanyConfig.ConfigurationId}}

14 |

Company Name: {{.AppConfig.CompanyConfig.CompanyName}}

15 |

Company Acronym: {{.AppConfig.CompanyConfig.CompanyAcronym}}

16 |

Company Phone: {{.AppConfig.CompanyConfig.CompanyPhone}}

17 |

Company Email: {{.AppConfig.CompanyConfig.CompanyEmail}}

18 |

Unique ID: {{.AppConfig.CompanyConfig.UniqueId}}

19 |

Creation Date: {{.AppConfig.CompanyConfig.CreatedAt}}

20 |

Last Update: {{.AppConfig.CompanyConfig.UpdatedAt}}

21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/configuration/core-entity/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.CoreEntity.EntityId}}

15 |

Entity Name: {{.CoreEntity.EntityName}}

16 |

Code: {{.CoreEntity.Code}}

17 |

Associated Module: {{.CoreEntity.ModuleName}}

18 |

Description: {{.CoreEntity.Description}}

19 |

Creation Date: {{.CoreEntity.CreatedAt}}

20 |

Last Update: {{.CoreEntity.UpdatedAt}}

21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/configuration/core-entity/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/configuration/email/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 10 |

SMTP Server: {{.AppConfig.EmailConfig.SMTPServer}}

11 |

SMTP Port: {{.AppConfig.EmailConfig.SMTPPort}}

12 |

Sender Email: {{.AppConfig.EmailConfig.SenderEmail}}

13 |

Sender Password: {{.AppConfig.EmailConfig.SenderPassword}}

14 |
15 | 16 | {{ template "_partials/footer-back" .}} 17 | -------------------------------------------------------------------------------- /public/templates/configuration/module-flag/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {{ range .ModuleFlags }} 22 | 23 | 24 | 25 | 29 | 30 | 31 | {{ end }} 32 | 33 |
ModuleCodeStatusLast Update
{{.ModuleName}}{{.Code}} 26 | 27 | {{.Status}} 28 | {{.UpdatedAt}}
34 | 35 |
36 | 37 | {{ template "_partials/footer-back" .}} 38 | -------------------------------------------------------------------------------- /public/templates/employee/document-type/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.DocumentType.TypeId}}

15 |

Type Name: {{.DocumentType.TypeName}}

16 |

Description: {{.DocumentType.Description}}

17 |

Creation Date: {{.DocumentType.CreatedAt}}

18 |

Last Update: {{.DocumentType.UpdatedAt}}

19 |
20 | 21 | {{ template "_partials/footer-back" .}} 22 | -------------------------------------------------------------------------------- /public/templates/employee/document-type/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/employee/employee-info/details-health.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/templates/employee/employee-info/details-health.html -------------------------------------------------------------------------------- /public/templates/employee/employee-info/details-personal.html: -------------------------------------------------------------------------------- 1 | 7 | 8 |

Employee ID: {{.Employee.EmployeeId}}

9 |

Full Name: {{.Employee.FirstName}} {{.Employee.LastName}}

10 |

Identification Number: {{.Employee.IdentificationNumber}}

11 |

Gender: {{.Employee.Gender}}

12 |

Date of Birth: {{.Employee.DateOfBirth}}

13 |

Identification Type: {{.Employee.IdentificationTypeName}}

14 |

Country: {{.Employee.CountryName}}

15 |

Marital Status: {{.Employee.MaritalStatusName}}

16 |

Creation Date: {{.Employee.CreatedAt}}

17 |

Last Update: {{.Employee.UpdatedAt}}

-------------------------------------------------------------------------------- /public/templates/employee/employee-info/details-professional.html: -------------------------------------------------------------------------------- 1 | {{ if .EmployeeProfessionalInfo.JobTitleName }} 2 | 8 |

Department: {{.EmployeeProfessionalInfo.DepartmentName}}

9 |

Employment Status: {{.EmployeeProfessionalInfo.EmploymentStatusName}}

10 |

Job Title: {{.EmployeeProfessionalInfo.JobTitleName}}

11 | {{ else }} 12 | 18 | {{ end }} -------------------------------------------------------------------------------- /public/templates/employee/employee-info/details-user-account.html: -------------------------------------------------------------------------------- 1 | {{ if .EmployeeAccount.UserId }} 2 |

User Name: {{.EmployeeAccount.UserName}}

3 |

Email Account: {{.EmployeeAccount.Email}}

4 |

Creation Date: {{.EmployeeAccount.CreatedAt}}

5 |

Last Update: {{.EmployeeAccount.UpdatedAt}}

6 | {{ else }} 7 | 17 | {{ end}} -------------------------------------------------------------------------------- /public/templates/employee/employee-info/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/employee/job-title/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.JobTitle.JobTitleId}}

15 |

Title Name: {{.JobTitle.TitleName}}

16 |

Description: {{.JobTitle.Description}}

17 |

Creation Date: {{.JobTitle.CreatedAt}}

18 |

Last Update: {{.JobTitle.UpdatedAt}}

19 |
20 | 21 | {{ template "_partials/footer-back" .}} 22 | -------------------------------------------------------------------------------- /public/templates/employee/job-title/edit.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 18 |
19 | 20 | 21 | Cancel 22 | 23 |
24 |
25 |
26 | 27 | {{ template "_partials/footer-back" .}} 28 | -------------------------------------------------------------------------------- /public/templates/employee/job-title/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/approval-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/contact-type/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.ContactType.TypeId}}

15 |

Type Name: {{.ContactType.TypeName}}

16 |

Code: {{.ContactType.Code}}

17 |

Creation Date: {{.ContactType.CreatedAt}}

18 |

Last Update: {{.ContactType.UpdatedAt}}

19 |
20 | 21 | {{ template "_partials/footer-back" .}} 22 | -------------------------------------------------------------------------------- /public/templates/reference/contact-type/edit.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 18 |
19 | 20 | 21 | Cancel 22 | 23 |
24 |
25 |
26 | 27 | {{ template "_partials/footer-back" .}} 28 | -------------------------------------------------------------------------------- /public/templates/reference/contact-type/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/country/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

Flag:

15 |

ID: {{.Country.CountryId}}

16 |

Country Name: {{.Country.CountryName}}

17 |

ISO Code: {{.Country.IsoCode}}

18 |

Dialing Code: {{.Country.DialingCode}}

19 |

Creation Date: {{.Country.CreatedAt}}

20 |

Last Update: {{.Country.UpdatedAt}}

21 |
22 | 23 | {{ template "_partials/footer-back" .}} 24 | -------------------------------------------------------------------------------- /public/templates/reference/country/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/currency/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.Currency.CurrencyId}}

15 |

Currency Name: {{.Currency.CurrencyName}}

16 |

Code: {{.Currency.Code}}

17 |

Symbol: {{.Currency.Symbol}}

18 |

Creation Date: {{.Currency.CreatedAt}}

19 |

Last Update: {{.Currency.UpdatedAt}}

20 |
21 | 22 | {{ template "_partials/footer-back" .}} 23 | -------------------------------------------------------------------------------- /public/templates/reference/currency/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/document-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/employment-status/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.EmploymentStatus.StatusId}}

15 |

Status Name: {{.EmploymentStatus.StatusName}}

16 |

Code: {{.EmploymentStatus.Code}}

17 |

Description: {{.EmploymentStatus.Description}}

18 |

Creation Date: {{.EmploymentStatus.CreatedAt}}

19 |

Last Update: {{.EmploymentStatus.UpdatedAt}}

20 |
21 | 22 | {{ template "_partials/footer-back" .}} 23 | -------------------------------------------------------------------------------- /public/templates/reference/employment-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/evaluation-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/identification-type/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.IdentificationType.TypeId}}

15 |

Type Name: {{.IdentificationType.TypeName}}

16 |

Code: {{.IdentificationType.Code}}

17 |

Creation Date: {{.IdentificationType.CreatedAt}}

18 |

Last Update: {{.IdentificationType.UpdatedAt}}

19 |
20 | 21 | {{ template "_partials/footer-back" .}} 22 | -------------------------------------------------------------------------------- /public/templates/reference/identification-type/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/marital-status/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.MaritalStatus.StatusId}}

15 |

Status Name: {{.MaritalStatus.StatusName}}

16 |

Code: {{.MaritalStatus.Code}}

17 |

Creation Date: {{.MaritalStatus.CreatedAt}}

18 |

Last Update: {{.MaritalStatus.UpdatedAt}}

19 |
20 | 21 | {{ template "_partials/footer-back" .}} 22 | -------------------------------------------------------------------------------- /public/templates/reference/marital-status/edit.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 18 |
19 | 20 | 21 | Cancel 22 | 23 |
24 |
25 |
26 | 27 | {{ template "_partials/footer-back" .}} 28 | -------------------------------------------------------------------------------- /public/templates/reference/marital-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/task-status/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.TaskStatus.StatusId}}

15 |

Status Name: {{.TaskStatus.StatusName}}

16 |

Code: {{.TaskStatus.Code}}

17 |

Label Color: {{.TaskStatus.LblColor}}

18 |

Background color: {{.TaskStatus.BgColor}}

19 |

Description: {{.TaskStatus.Description}}

20 |

Creation Date: {{.TaskStatus.CreatedAt}}

21 |

Last Update: {{.TaskStatus.UpdatedAt}}

22 |
23 | 24 | {{ template "_partials/footer-back" .}} 25 | -------------------------------------------------------------------------------- /public/templates/reference/task-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/user-status/details.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 | 14 |

ID: {{.UserStatus.StatusId}}

15 |

Status Name: {{.UserStatus.StatusName}}

16 |

Code: {{.UserStatus.Code}}

17 |

Label Color: {{.UserStatus.LblColor}}

18 |

Background color: {{.UserStatus.BgColor}}

19 |

Description: {{.UserStatus.Description}}

20 |

Creation Date: {{.UserStatus.CreatedAt}}

21 |

Last Update: {{.UserStatus.UpdatedAt}}

22 |
23 | 24 | {{ template "_partials/footer-back" .}} 25 | -------------------------------------------------------------------------------- /public/templates/reference/user-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reference/workflow-status/search.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 |
4 |
5 |
6 | 7 | 8 | 9 | 14 | 15 |
10 | 13 |
16 |
17 |
18 |
19 | 20 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reports/company/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reports/configuration/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reports/employee/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/templates/reports/user/index.html: -------------------------------------------------------------------------------- 1 | {{ template "_partials/header-back" .}} 2 | 3 | {{ template "_partials/footer-back" .}} -------------------------------------------------------------------------------- /public/uploads/images/users/0a24cec6-bc8b-4cdd-9af8-2eb41c168045.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/0a24cec6-bc8b-4cdd-9af8-2eb41c168045.jpeg -------------------------------------------------------------------------------- /public/uploads/images/users/14ccf714-cb8a-44db-9d49-f8b1b69cd0dc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/14ccf714-cb8a-44db-9d49-f8b1b69cd0dc.jpg -------------------------------------------------------------------------------- /public/uploads/images/users/362bc6af-dd97-44f3-bc7d-e8c5c22d1129.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/362bc6af-dd97-44f3-bc7d-e8c5c22d1129.jpg -------------------------------------------------------------------------------- /public/uploads/images/users/3a563b32-d269-45ba-8031-653195922c0b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/3a563b32-d269-45ba-8031-653195922c0b.jpg -------------------------------------------------------------------------------- /public/uploads/images/users/7a0588fa-d015-46d0-ae8b-75c9904c44a0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/7a0588fa-d015-46d0-ae8b-75c9904c44a0.jpg -------------------------------------------------------------------------------- /public/uploads/images/users/9cb5dcaf-0c9f-4726-9b10-304f9262d378.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/9cb5dcaf-0c9f-4726-9b10-304f9262d378.jpg -------------------------------------------------------------------------------- /public/uploads/images/users/a77f98b3-d0d4-4312-b71a-cde1ca2f8c98.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortizdavid/golang-modular-software/539bf66ba5b403bab3eb688c5bf3226c58f38e54/public/uploads/images/users/a77f98b3-d0d4-4312-b71a-cde1ca2f8c98.jpg --------------------------------------------------------------------------------