summaryrefslogtreecommitdiff
path: root/internal/queries
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-08 10:57:56 -0600
committerT <t@tjp.lol>2025-08-12 14:45:56 -0600
commitdaea67322cd387c2caf8f1a326c90b4276c6e9bc (patch)
treeda1d2a85e530640a1ed804fece38da30940e7dd5 /internal/queries
parent54c791927b2851fb6739ed75897090c3c39ecca1 (diff)
bugfixes
Diffstat (limited to 'internal/queries')
-rw-r--r--internal/queries/queries.sql.go26
1 files changed, 9 insertions, 17 deletions
diff --git a/internal/queries/queries.sql.go b/internal/queries/queries.sql.go
index fb7f390..35d90ea 100644
--- a/internal/queries/queries.sql.go
+++ b/internal/queries/queries.sql.go
@@ -128,11 +128,7 @@ values (
?1,
?2,
?3,
- coalesce(
- ?4,
- (select p.billable_rate from project p where p.id = ?3),
- (select c.billable_rate from client c where c.id = ?2)
- )
+ ?4
)
returning id, start_time, end_time, description, client_id, project_id, billable_rate
`
@@ -141,7 +137,7 @@ type CreateTimeEntryParams struct {
Description sql.NullString
ClientID int64
ProjectID sql.NullInt64
- BillableRate interface{}
+ BillableRate sql.NullInt64
}
func (q *Queries) CreateTimeEntry(ctx context.Context, arg CreateTimeEntryParams) (TimeEntry, error) {
@@ -172,11 +168,7 @@ values (
?3,
?4,
?5,
- coalesce(
- ?6,
- (select p.billable_rate from project p where p.id = ?5),
- (select c.billable_rate from client c where c.id = ?4)
- )
+ ?6
)
returning id, start_time, end_time, description, client_id, project_id, billable_rate
`
@@ -187,7 +179,7 @@ type CreateTimeEntryWithTimesParams struct {
Description sql.NullString
ClientID int64
ProjectID sql.NullInt64
- BillableRate interface{}
+ BillableRate sql.NullInt64
}
func (q *Queries) CreateTimeEntryWithTimes(ctx context.Context, arg CreateTimeEntryWithTimesParams) (TimeEntry, error) {
@@ -215,8 +207,8 @@ func (q *Queries) CreateTimeEntryWithTimes(ctx context.Context, arg CreateTimeEn
const editTimeEntry = `-- name: EditTimeEntry :exec
update time_entry
set
- start_time = ?1,
- end_time = ?2,
+ start_time = datetime(?1),
+ end_time = datetime(?2),
description = ?3,
client_id = ?4,
project_id = ?5,
@@ -225,8 +217,8 @@ where id = ?7
`
type EditTimeEntryParams struct {
- StartTime time.Time
- EndTime sql.NullTime
+ StartTime interface{}
+ EndTime interface{}
Description sql.NullString
ClientID int64
ProjectID sql.NullInt64
@@ -404,7 +396,7 @@ func (q *Queries) GetHighestInvoiceNumber(ctx context.Context, arg GetHighestInv
}
const getInvoiceDataByClient = `-- name: GetInvoiceDataByClient :many
-select
+select
te.id as time_entry_id,
te.start_time,
te.end_time,