From fa02041867819fd57c02453a4a9094c6f2eef464 Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Thu, 12 Nov 2026 10:54:02 -0500 Subject: [PATCH] chore(planning): trying something new, actually planning before making --- .gitignore | 1 + main.go | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d219532..d2d2a03 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ .env .env.* +bin/ diff --git a/main.go b/main.go index 8cd8b97..44e81be 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,115 @@ package main -import ("fmt") +import ( + "fmt" +) + +/* +Id int +Desc string +Amount float +Date date.now() +*/ +type Expense struct { +} + +/* +--description: Label for the expense : string +--amount how much it cost : float + +saves date as well + +returns an expense table to be saved later +*/ + +/* +$ expense-tracker add --description "Lunch" --amount 20 +# Expense added successfully (ID: 1) + +$ expense-tracker add --description "Dinner" --amount 10 +# Expense added successfully (ID: 2) +*/ +func add(fileName string, desc string, amount float32) []Expense { + /* + 1. Takes in a fileName and loades an Expense slice + 2. Creates a new Expense object with id++ of last id in Expense slice, date, desc and amount + 3. return Expense slice + */ +} + +/* +$ expense-tracker list +# ID Date Description Amount +# 1 2024-08-06 Lunch $20 +# 2 2024-08-06 Dinner $10 +*/ +func list() { + /* + 1. Load tasks + 2. Print a single newline statement for section headers + 3. Loop over tasks and print id, date, descript, amount + */ +} + +/* +$ expense-tracker delete --id 2 +# Expense deleted successfully + +takes Id and loops over loaded tasks to remove object +*/ +func delete() { + +} + +/* + +$ expense-tracker update --id 2 --description "new desc" +# Expense updated successfully + +$ expense-tracker update --id 2 --amount 10 +# Expense updated successfully + +$ expense-tracker update --id 2 --description "new desc" --amount 10 +# Expense updated successfully + +takes in an id, a string for desc (if "" then it is blank and dont update), a new amount (if -1 then it is blank and dont update) +*/ + +func update() { + +} + +/* +$ expense-tracker summary +# Total expenses: $30 + +$ expense-tracker summary +# Total expenses: $20 + +$ expense-tracker summary --month 8 +# Total expenses for August: $20 +*/ +func summary() { + /* + + 1. Loads expenses to slice + 2. Count all amounts from each expense + 3. print expenses + 3.5 If month passed in then print all expenses for that month and only count for those months + */ + +} + +// Saves expenses table to a json file +func saveExpenses() { + +} + +// Loades expenses table from a json file +func loadExpenses() { + +} func main() { - fmt.Println("Hello World") + fmt.Println("Hello World") }