From e8fb806e89ef7e5d05de854843a9375fccfedae0 Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Sat, 28 Mar 2026 19:25:31 +0300 Subject: [PATCH 01/10] Add files via upload --- spec.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 spec.txt diff --git a/spec.txt b/spec.txt new file mode 100644 index 00000000..08dbf4e2 --- /dev/null +++ b/spec.txt @@ -0,0 +1,68 @@ +PROJECT: mini-budget +AUTHOR: Deniz Yücel Uzunay (251478081) +VERSION: v1 +DATE: 2026-03-16 + +======================================== +OVERVIEW +======================================== + +mini-budget is a command-line income and expense tracker. +It stores financial transactions in a plain text file and supports +adding, listing, checking balance, and deleting transactions. + +All data is persisted in a directory called .minibudget/ +in the current working directory. + +======================================== +COMMANDS +======================================== + +--- init --- +Usage: python minibudget.py init +Creates a .minibudget/ directory and an empty transactions.dat file. +If .minibudget/ already exists, print "Already initialized" and exit. + +--- add --- +Usage: python minibudget.py add "" +TYPE must be either INCOME or EXPENSE. +Appends a new transaction to transactions.dat. +Each transaction has: id (auto-increment), type, amount, description, created_date. +Prints "Added transaction #: " + +--- list --- +Usage: python minibudget.py list +Prints all transactions, one per line: + [1] [INCOME] 5000 - Salary (2026-03-16) + [2] [EXPENSE] 150 - Groceries (2026-03-16) +If no transactions exist, prints "No transactions found." + +--- balance --- +Usage: python minibudget.py balance +Calculates the total balance (Total INCOME - Total EXPENSE). +Prints "Current Balance: " + +--- delete --- +Usage: python minibudget.py delete 1 +Removes transaction #1 from transactions.dat. +Prints "Deleted transaction #1." +If transaction does not exist, prints "Transaction #1 not found." + +======================================== +DATA FORMAT +======================================== + +File: .minibudget/transactions.dat +Format: One transaction per line, fields separated by | +Example: +1|INCOME|5000|Salary|2026-03-16 +2|EXPENSE|150|Groceries|2026-03-16 + +======================================== +ERROR HANDLING +======================================== + +- Running any command before "init": print "Not initialized. Run: python minibudget.py init" +- Invalid command: print "Unknown command: " +- Missing arguments: print "Usage: python minibudget.py [args]" +- Negative amount: If is less than 0, print "Error: Amount must be positive." \ No newline at end of file From dc87486d8371bea9edbf01c969873937a9eaac5c Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Wed, 15 Apr 2026 17:02:19 +0300 Subject: [PATCH 02/10] Create problem.json --- problems/minibudget/problem.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 problems/minibudget/problem.json diff --git a/problems/minibudget/problem.json b/problems/minibudget/problem.json new file mode 100644 index 00000000..9acc91ee --- /dev/null +++ b/problems/minibudget/problem.json @@ -0,0 +1,4 @@ +{ + "name": "minibudget", + "author": "Deniz Yücel Uzunay" +} From 06ee2786b3ad1a213895cecfdec3badb7b00b256 Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Wed, 15 Apr 2026 17:03:14 +0300 Subject: [PATCH 03/10] Create SPEC-v1.txt --- problems/minibudget/SPEC-v1.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 problems/minibudget/SPEC-v1.txt diff --git a/problems/minibudget/SPEC-v1.txt b/problems/minibudget/SPEC-v1.txt new file mode 100644 index 00000000..12ed8b99 --- /dev/null +++ b/problems/minibudget/SPEC-v1.txt @@ -0,0 +1,3 @@ +PROJECT: minibudget +OVERVIEW: A command-line income and expense tracker. +COMMANDS: init, add, list. From 1eeb76b68749be440ccff2f2e56a9c7ed7c10c8d Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Wed, 15 Apr 2026 17:03:36 +0300 Subject: [PATCH 04/10] Create SPEC-v2.txt --- problems/minibudget/SPEC-v2.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 problems/minibudget/SPEC-v2.txt diff --git a/problems/minibudget/SPEC-v2.txt b/problems/minibudget/SPEC-v2.txt new file mode 100644 index 00000000..9e7c1734 --- /dev/null +++ b/problems/minibudget/SPEC-v2.txt @@ -0,0 +1,4 @@ +PROJECT: minibudget +OVERVIEW: A command-line income and expense tracker. +COMMANDS: init, add, list. +ERROR HANDLING: If amount is negative, print "Error: Amount must be positive." From b8e62f8a29365305d3ebc7f1d4879e3cbf0abb03 Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Wed, 15 Apr 2026 17:03:54 +0300 Subject: [PATCH 05/10] Create test-v1.sh --- problems/minibudget/test-v1.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 problems/minibudget/test-v1.sh diff --git a/problems/minibudget/test-v1.sh b/problems/minibudget/test-v1.sh new file mode 100644 index 00000000..06bd9865 --- /dev/null +++ b/problems/minibudget/test-v1.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exit 0 From 75b90a86e4fb067d9b466656ec9394affba23ae0 Mon Sep 17 00:00:00 2001 From: dennys67wq Date: Wed, 15 Apr 2026 17:04:10 +0300 Subject: [PATCH 06/10] Create test-v2.sh --- problems/minibudget/test-v2.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 problems/minibudget/test-v2.sh diff --git a/problems/minibudget/test-v2.sh b/problems/minibudget/test-v2.sh new file mode 100644 index 00000000..06bd9865 --- /dev/null +++ b/problems/minibudget/test-v2.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exit 0 From d95bdde500add63a32489af4392226b065a0a560 Mon Sep 17 00:00:00 2001 From: denizyucell Date: Wed, 15 Apr 2026 17:25:26 +0300 Subject: [PATCH 07/10] Update test-v1.sh --- problems/minibudget/test-v1.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/problems/minibudget/test-v1.sh b/problems/minibudget/test-v1.sh index 06bd9865..136084a4 100644 --- a/problems/minibudget/test-v1.sh +++ b/problems/minibudget/test-v1.sh @@ -1,2 +1,23 @@ #!/bin/bash -exit 0 +# Test V1 Specifications for minibudget + +# Clean up before testing +rm -rf .minibudget + +# Test initialization +python3 minibudget.py init + +# Test adding transactions +python3 minibudget.py add INCOME 5000 "Salary" +python3 minibudget.py add EXPENSE 150 "Groceries" + +# Test listing transactions +OUTPUT=$(python3 minibudget.py list) + +if [[ "$OUTPUT" == *"Salary"* ]] && [[ "$OUTPUT" == *"Groceries"* ]]; then + echo "V1 Tests Passed successfully." + exit 0 +else + echo "V1 Tests Failed." + exit 1 +fi From b0303335ac39135f4d81dadab1d70da963b7ea48 Mon Sep 17 00:00:00 2001 From: denizyucell Date: Wed, 15 Apr 2026 17:25:36 +0300 Subject: [PATCH 08/10] Update test-v2.sh --- problems/minibudget/test-v2.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/problems/minibudget/test-v2.sh b/problems/minibudget/test-v2.sh index 06bd9865..136084a4 100644 --- a/problems/minibudget/test-v2.sh +++ b/problems/minibudget/test-v2.sh @@ -1,2 +1,23 @@ #!/bin/bash -exit 0 +# Test V1 Specifications for minibudget + +# Clean up before testing +rm -rf .minibudget + +# Test initialization +python3 minibudget.py init + +# Test adding transactions +python3 minibudget.py add INCOME 5000 "Salary" +python3 minibudget.py add EXPENSE 150 "Groceries" + +# Test listing transactions +OUTPUT=$(python3 minibudget.py list) + +if [[ "$OUTPUT" == *"Salary"* ]] && [[ "$OUTPUT" == *"Groceries"* ]]; then + echo "V1 Tests Passed successfully." + exit 0 +else + echo "V1 Tests Failed." + exit 1 +fi From e93e1c3b18d9e434d713ffb3535fb5f191c27e5f Mon Sep 17 00:00:00 2001 From: denizyucell Date: Wed, 15 Apr 2026 17:25:57 +0300 Subject: [PATCH 09/10] Update problem.json --- problems/minibudget/problem.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/minibudget/problem.json b/problems/minibudget/problem.json index 9acc91ee..f4cfe927 100644 --- a/problems/minibudget/problem.json +++ b/problems/minibudget/problem.json @@ -1,4 +1,4 @@ { "name": "minibudget", - "author": "Deniz Yücel Uzunay" + "author": "Deniz Yucel Uzunay" } From add31c616da52626033e495390620d4a36750fee Mon Sep 17 00:00:00 2001 From: denizyucell Date: Tue, 21 Apr 2026 21:40:56 +0300 Subject: [PATCH 10/10] Update SPEC-v2.txt --- problems/minibudget/SPEC-v2.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problems/minibudget/SPEC-v2.txt b/problems/minibudget/SPEC-v2.txt index 9e7c1734..3dfd8e61 100644 --- a/problems/minibudget/SPEC-v2.txt +++ b/problems/minibudget/SPEC-v2.txt @@ -2,3 +2,5 @@ PROJECT: minibudget OVERVIEW: A command-line income and expense tracker. COMMANDS: init, add, list. ERROR HANDLING: If amount is negative, print "Error: Amount must be positive." +NEW COMMAND: delete - Removes a transaction by its ID. +ERROR HANDLING: If ID does not exist during delete, print "Error: Transaction not found."