basic internal structure

This commit is contained in:
samantha42
2026-03-24 11:17:08 +01:00
parent 29b3c2dd6c
commit a9d4f09b62
14 changed files with 407 additions and 3 deletions

16
internal/service/main.go Normal file
View File

@@ -0,0 +1,16 @@
package service
import (
"Portifolio/internal/model"
"database/sql"
_ "github.com/mattn/go-sqlite3"
)
func AddCompany(input model.CompanyInput, db *sql.DB) error {
_, err := db.Exec(
`INSERT INTO companies (name, shares_outstanding, price, currency_id) VALUES (?, ?, ?, ?)`,
input.Name, input.SharesOutstanding, input.Price, input.CurrencyID,
)
return err
}