Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Script SQL para crear esquema de base de datos financiera (Opción A)

Đang mở
#742 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
mysql, sql
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu bằng việc xem xét schema MySQL được đề xuất trong issue và giải quyết các câu hỏi còn bỏ ngỏ về người dùng, lịch sử kiểm toán và quyền sở hữu danh mục. Công việc được xem là hoàn tất khi một tập lệnh SQL tương thích với MySQL định nghĩa các bảng bắt buộc transactions, budgets và savings_goals với các khóa, kiểu dữ liệu và tham chiếu phù hợp, cùng với accounts nếu được chọn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Descripción

Crear un script SQL que defina el esquema inicial de la base de datos para un sistema de finanzas personales. Este sistema permitirá registrar transacciones, presupuestos, metas de ahorro y (opcionalmente) usuarios y cuentas. El esquema debe ser compatible con MySQL y cubrir el MVP de la aplicación.

Tablas requeridas:

  • transactions: registro de ingresos/gastos, categorías y descripción.
  • budgets: presupuestos por categoría y periodo.
  • savings_goals: metas de ahorro con estado.
  • (Opcional: accounts para soportar varias cuentas o wallets)

Debe incluir claves primarias, tipos de datos adecuados y referencias entre tablas donde aplique.

Why
  • Permite que el backend almacene y consulte los datos financieros de forma estructurada.
  • Facilita la generación de reportes “fin de mes”, seguimiento de objetivos y visualización de gastos/ingresos.
  • Es fundamental para el funcionamiento de toda la app y para poder avanzar hacia la integración con frontend y generación de reportes.
Possible Implementation & Open Questions

Script SQL sugerido:

CREATE TABLE accounts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    currency VARCHAR(10) DEFAULT 'MXN',
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE transactions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    account_id INT DEFAULT NULL,
    type ENUM('income','expense') NOT NULL,
    amount DECIMAL(12,2) NOT NULL,
    category VARCHAR(100),
    description TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);

CREATE TABLE budgets (
    id INT AUTO_INCREMENT PRIMARY KEY,
    account_id INT DEFAULT NULL,
    category VARCHAR(100) NOT NULL,
    limit_amount DECIMAL(12,2) NOT NULL,
    period ENUM('monthly','weekly','yearly') NOT NULL DEFAULT 'monthly',
    start_date DATE DEFAULT NULL,
    end_date DATE DEFAULT NULL,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);

CREATE TABLE savings_goals (
    id INT AUTO_INCREMENT PRIMARY KEY,
    account_id INT DEFAULT NULL,
    name VARCHAR(100) NOT NULL,
    target_amount DECIMAL(12,2) NOT NULL,
    saved_amount DECIMAL(12,2) DEFAULT 0.0,
    icon VARCHAR(50),
    target_date DATE DEFAULT NULL,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);

Preguntas abiertas:

  • ¿Es necesario soportar múltiples usuarios o es solo para uso personal? (si sí, agregar tabla users y relación con cuentas)
  • ¿Se requiere historial de modificaciones (audit trail)?
  • ¿Se usarán categorías predefinidas o personalizables?
Is this something you're interested in working on?
  • YES
  • NO
Ngôn ngữ chính
Python
Star
284k
Fork
36.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của practical-tutorials/project-based-learning

Tất cả issue của practical-tutorials/project-based-learning

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.