from flask import Blueprint, jsonify
from app.models.invoice import Invoice
from app.database import db

invoice_bp = Blueprint("invoices", __name__)

@invoice_bp.route("/", methods=["GET"])
def get_invoices():
    invoices = Invoice.query.all()
    return jsonify([{"id": i.id, "amount": i.amount, "user_id": i.user_id} for i in invoices])
