{
  "format": "dataset-manifest/1",
  "slug": "invoice-factoring-and-financing-app",
  "version": 3,
  "seed": "invoice-factoring-and-financing-app:1",
  "engine": 1,
  "engineVersion": "1.0.0",
  "spec": {
    "format": "dataset/1",
    "slug": "invoice-factoring-and-financing-app",
    "name": "Invoice Financing Ledger",
    "tagline": "Invoices, debtors, risk assessments, funding requests, and payments for managing cash flow through invoice financing.",
    "description": "Businesses manage their cash flow by converting unpaid invoices into immediate working capital through invoice factoring. Companies submit invoices for goods or services rendered, and in turn, debtors are responsible for settling these invoices. This operation forms the backbone of the invoice financing ledger, where the flow of cash is critical to maintaining business liquidity. Understanding this process involves analyzing the relationships between several key entities: invoices, debtors, risk assessments, funding requests, and payments. \n\nEach invoice entry records the amount owed, due dates, and associated debtor information, while debtors hold details about the customers who owe these amounts. Risk assessments evaluate the creditworthiness of these debtors, helping businesses to determine the likelihood of timely payments. Funding requests indicate the amounts companies seek to finance their unpaid invoices, and payments track the actual money received against these invoices. The interplay between these tables allows for a rich analysis of financial health and risk profile. For instance, one can join invoices with debtors to analyze payment patterns, or link funding requests with risk assessments to gauge the effectiveness of funding strategies. \n\nThis data is particularly valuable for practicing financial analytics, offering insights into cash flow management, debtor behavior, and the efficacy of risk evaluations. Users can explore questions such as: How do funding requests correlate with the risk ratings of debtors? What patterns emerge in payment behavior across different debtor categories? How do invoice amounts influence risk assessments? \n\nIt’s important to note that the data contained within this dataset is synthetic, crafted to replicate real-world scenarios while ensuring no sensitive information is present. This makes it an excellent resource for honing analytical skills in the fintech domain.",
    "domain": "fintech",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "invoice",
      "factoring",
      "financing",
      "debtor",
      "risk assessment",
      "payments",
      "cash flow",
      "business",
      "financial management"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "invoices": {
        "description": "Each row represents an invoice submitted by a business, detailing the issue date, due date, amount, and its associated debtor.",
        "rows": 250,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each invoice."
          },
          "debtor_id": {
            "kind": "fk",
            "ref": "debtors.id",
            "description": "References the debtor responsible for payment."
          },
          "issue_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the invoice was issued."
          },
          "due_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the invoice is due for payment."
          },
          "amount": {
            "kind": "decimal",
            "min": 100,
            "max": 100000,
            "scale": 2,
            "skew": "heavy-tail",
            "description": "Total amount of the invoice.",
            "distribution": "long-tail"
          }
        }
      },
      "debtors": {
        "description": "This table lists debtors corresponding to each invoice, providing credit ratings and contact information.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each debtor."
          },
          "name": {
            "kind": "fullName",
            "description": "Full name of the debtor."
          },
          "credit_rating": {
            "kind": "enum",
            "values": [
              "A",
              "B",
              "C",
              "D",
              "E"
            ],
            "description": "Credit rating indicating the financial reliability of the debtor.",
            "nullable": true,
            "weights": [
              6,
              3,
              2,
              1,
              1
            ]
          },
          "contact_email": {
            "kind": "email",
            "from": "name",
            "description": "Email address of the debtor."
          },
          "phone_number": {
            "kind": "phone",
            "description": "Contact phone number of the debtor."
          }
        }
      },
      "risk_assessments": {
        "description": "Rows in this table reflect assessments of debtors' creditworthiness, linked to the corresponding debtor.",
        "rows": 150,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each risk assessment."
          },
          "debtor_id": {
            "kind": "fk",
            "ref": "debtors.id",
            "description": "References the debtor being assessed."
          },
          "assessment_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date the risk assessment was conducted."
          },
          "risk_score": {
            "kind": "int",
            "min": 1,
            "max": 100,
            "description": "Risk score assigned to the debtor based on the assessment.",
            "distribution": "high"
          },
          "risk_category": {
            "kind": "enum",
            "values": [
              "low",
              "medium",
              "high"
            ],
            "weights": [
              50,
              30,
              20
            ],
            "description": "Category of risk based on the assessment."
          },
          "previous_assessments": {
            "kind": "int",
            "min": 0,
            "max": 5,
            "distribution": "normal",
            "description": "Number of previous risk assessments conducted."
          }
        }
      },
      "funding_requests": {
        "description": "This table captures requests for funding related to specific invoices, detailing amounts and request dates.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each funding request."
          },
          "invoice_id": {
            "kind": "fk",
            "ref": "invoices.id",
            "description": "References the invoice for which funding is requested."
          },
          "request_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the funding request was made."
          },
          "requested_amount": {
            "kind": "decimal",
            "min": 100,
            "max": 50000,
            "scale": 2,
            "description": "Amount requested for funding.",
            "distribution": "long-tail"
          },
          "approval_status": {
            "kind": "enum",
            "values": [
              "approved",
              "pending",
              "rejected"
            ],
            "weights": [
              50,
              30,
              20
            ],
            "description": "Current status of the funding request."
          },
          "funding_term": {
            "kind": "int",
            "min": 1,
            "max": 12,
            "distribution": "normal",
            "description": "Term of the funding in months."
          }
        }
      },
      "payments": {
        "description": "This table records payments made against invoices, including payment dates and amounts.",
        "rows": 180,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each payment."
          },
          "invoice_id": {
            "kind": "fk",
            "ref": "invoices.id",
            "description": "References the invoice associated with the payment."
          },
          "payment_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the payment was made."
          },
          "payment_amount": {
            "kind": "decimal",
            "min": 100,
            "max": 100000,
            "scale": 2,
            "description": "Amount that was paid.",
            "distribution": "long-tail"
          },
          "payment_method": {
            "kind": "enum",
            "values": [
              "bank transfer",
              "credit card",
              "cash"
            ],
            "weights": [
              60,
              30,
              10
            ],
            "description": "Method used for the payment."
          },
          "transaction_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the transaction was recorded."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "monetary",
      "categorical",
      "nullable"
    ],
    "analysisQuestions": [
      "What is the average payment time for invoices across different debtors?",
      "Which debtors have the highest risk scores, and how does this affect their invoice amounts?",
      "How do payment patterns vary over time for different invoice amounts?",
      "What percentage of funding requests are approved versus denied?",
      "What is the relationship between debtor credit ratings and their average invoice amounts?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Invoices and Debtors",
        "sql": "SELECT invoices.id, invoices.amount, debtors.name FROM invoices JOIN debtors ON invoices.debtor_id = debtors.id;",
        "dialect": "postgres"
      },
      {
        "title": "Group by Debtor Credit Rating",
        "sql": "SELECT debtors.credit_rating, AVG(invoices.amount) as average_invoice FROM invoices JOIN debtors ON invoices.debtor_id = debtors.id GROUP BY debtors.credit_rating;",
        "dialect": "postgres"
      },
      {
        "title": "Risk Assessment Impact on Funding Requests",
        "sql": "SELECT risk_assessments.risk_score, COUNT(funding_requests.id) as funding_requests_count FROM risk_assessments JOIN debtors ON risk_assessments.debtor_id = debtors.id JOIN funding_requests ON debtors.id = funding_requests.invoice_id GROUP BY risk_assessments.risk_score;",
        "dialect": "postgres"
      },
      {
        "title": "Payments Over Time",
        "sql": "SELECT DATE_TRUNC('month', payments.payment_date) as month, SUM(payments.payment_amount) as total_payments FROM payments GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Financial Analyst",
        "body": "A financial analyst uses this dataset to assess the average payment time across different debtors, helping the company to manage cash flow and optimize collections. They can identify patterns and trends that might indicate potential cash flow issues."
      },
      {
        "title": "Risk Manager",
        "body": "A risk manager analyzes debtor risk scores in relation to their invoice amounts. This analysis aids in making informed decisions about which debtors to pursue for collections and how to adjust credit policies."
      },
      {
        "title": "Educator",
        "body": "An educator uses this dataset in classroom settings to teach students about relational databases and SQL queries, allowing them to practice real-world financial data analysis scenarios."
      },
      {
        "title": "Business Owner",
        "body": "A small business owner examines the dataset to understand the risk associated with their debtors and to make informed decisions about invoice financing options, ensuring their business maintains healthy cash flow."
      }
    ]
  },
  "counts": {
    "debtors": 100,
    "invoices": 250,
    "funding_requests": 200,
    "payments": 180,
    "risk_assessments": 150
  },
  "stats": {
    "invoices": {
      "rows": 250,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 250,
          "min": 1,
          "max": 250
        },
        "debtor_id": {
          "nulls": 0,
          "distinct": 89,
          "min": 1,
          "max": 100
        },
        "issue_date": {
          "nulls": 0,
          "distinct": 222,
          "min": "2023-01-01",
          "max": "2024-12-29"
        },
        "due_date": {
          "nulls": 0,
          "distinct": 202,
          "min": "2023-01-04",
          "max": "2024-12-30"
        },
        "amount": {
          "nulls": 0,
          "distinct": 250,
          "min": 100.05,
          "max": 98758.31
        }
      }
    },
    "debtors": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "name": {
          "nulls": 0,
          "distinct": 98,
          "min": "Alice Garcia",
          "max": "Zara Wright"
        },
        "credit_rating": {
          "nulls": 15,
          "distinct": 5,
          "min": "A",
          "max": "E"
        },
        "contact_email": {
          "nulls": 0,
          "distinct": 100
        },
        "phone_number": {
          "nulls": 0,
          "distinct": 98
        }
      }
    },
    "risk_assessments": {
      "rows": 150,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "debtor_id": {
          "nulls": 0,
          "distinct": 80,
          "min": 1,
          "max": 99
        },
        "assessment_date": {
          "nulls": 0,
          "distinct": 134,
          "min": "2023-01-06",
          "max": "2024-12-29"
        },
        "risk_score": {
          "nulls": 0,
          "distinct": 74,
          "min": 2,
          "max": 100
        },
        "risk_category": {
          "nulls": 0,
          "distinct": 3,
          "min": "high",
          "max": "medium"
        },
        "previous_assessments": {
          "nulls": 0,
          "distinct": 5,
          "min": 0,
          "max": 4
        }
      }
    },
    "funding_requests": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "invoice_id": {
          "nulls": 0,
          "distinct": 134,
          "min": 1,
          "max": 248
        },
        "request_date": {
          "nulls": 0,
          "distinct": 175,
          "min": "2023-01-01",
          "max": "2024-12-24"
        },
        "requested_amount": {
          "nulls": 0,
          "distinct": 200,
          "min": 102.79,
          "max": 49469.84
        },
        "approval_status": {
          "nulls": 0,
          "distinct": 3,
          "min": "approved",
          "max": "rejected"
        },
        "funding_term": {
          "nulls": 0,
          "distinct": 10,
          "min": 2,
          "max": 11
        }
      }
    },
    "payments": {
      "rows": 180,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 180,
          "min": 1,
          "max": 180
        },
        "invoice_id": {
          "nulls": 0,
          "distinct": 127,
          "min": 1,
          "max": 249
        },
        "payment_date": {
          "nulls": 0,
          "distinct": 163,
          "min": "2023-01-02",
          "max": "2024-12-30"
        },
        "payment_amount": {
          "nulls": 0,
          "distinct": 180,
          "min": 100.16,
          "max": 98101.77
        },
        "payment_method": {
          "nulls": 0,
          "distinct": 3,
          "min": "bank transfer",
          "max": "credit card"
        },
        "transaction_date": {
          "nulls": 0,
          "distinct": 162,
          "min": "2023-01-06",
          "max": "2024-12-26"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/debtors.csv",
      "format": "csv",
      "table": "debtors",
      "key": "datasets/invoice-factoring-and-financing-app/v3/csv/debtors.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/csv/debtors.csv",
      "bytes": 5869,
      "sha256": "f840b19b89b4019db7b5b479511c2f231adc4f84ebb4e5093230320f0a61f378",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/invoices.csv",
      "format": "csv",
      "table": "invoices",
      "key": "datasets/invoice-factoring-and-financing-app/v3/csv/invoices.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/csv/invoices.csv",
      "bytes": 9550,
      "sha256": "15ad8707caf6c30b13d2aac6b8ec5e042ffe9cc0f5983c0cb2d7bbf06f67925c",
      "rows": 250,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/funding_requests.csv",
      "format": "csv",
      "table": "funding_requests",
      "key": "datasets/invoice-factoring-and-financing-app/v3/csv/funding_requests.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/csv/funding_requests.csv",
      "bytes": 7710,
      "sha256": "697fa88575e2b856f57276d06e27217c08f22aedf13a2d6a95c8f048759c607f",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payments.csv",
      "format": "csv",
      "table": "payments",
      "key": "datasets/invoice-factoring-and-financing-app/v3/csv/payments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/csv/payments.csv",
      "bytes": 9209,
      "sha256": "b164107e451b13ebca386184279b39ac58dd61bad030b4384d38c97ad7fb3445",
      "rows": 180,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/risk_assessments.csv",
      "format": "csv",
      "table": "risk_assessments",
      "key": "datasets/invoice-factoring-and-financing-app/v3/csv/risk_assessments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/csv/risk_assessments.csv",
      "bytes": 4309,
      "sha256": "cd792bf96fe1a3957c40f556f4b7788bfc593b70c2ec2f9d3360b3641df5eefd",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "invoice-factoring-and-financing-app.json",
      "format": "json",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/invoice-factoring-and-financing-app.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/invoice-factoring-and-financing-app.json",
      "bytes": 153726,
      "sha256": "90806ca9a3c4dfa771d62a7627b058ca002c82c45e885d756c491fcfeecce18c",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/sql/postgres.sql",
      "bytes": 53297,
      "sha256": "649c5c23b39dababc51195503281d8f1f59de17d818fcefb3b8561c56cd46fb8",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/sql/mysql.sql",
      "bytes": 52708,
      "sha256": "da205990beca7dc5219fee055d8a9f5090cbb35d5f4c7bf304b78cfed37035fe",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/sql/mssql.sql",
      "bytes": 55175,
      "sha256": "86c0362f39f0758ef62cb53e93347815e6643fbdef7bd88a32566864e5ac6c20",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/sql/sqlite.sql",
      "bytes": 52500,
      "sha256": "c665a74d5be366c909a94d2c0da8bd00be86cc16f36583b0ea7c8253193d8d9c",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/prisma/seed.ts",
      "bytes": 120092,
      "sha256": "293fa286d19ad45551d41a21b75fd8df3440374fc1603f79667601207e8c79f4",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/invoice-factoring-and-financing-app/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/invoice-factoring-and-financing-app/v3/django/fixtures.json",
      "bytes": 193684,
      "sha256": "ea108459de5ae41afa4d87ab84e0438e74cb31a136ad7a089acfe4518abe471f",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767907035,
  "updatedAt": 1789095900742
}
