@@ -17,10 +17,6 @@ func TestListMaintenanceWithSchedule(t *testing.T) {
1717 cat := MaintenanceCategory {Name : "TestCat" }
1818 require .NoError (t , store .db .Create (& cat ).Error )
1919
20- ptrTime := func (y , m , d int ) * time.Time {
21- t := time .Date (y , time .Month (m ), d , 0 , 0 , 0 , 0 , time .UTC )
22- return & t
23- }
2420 // Item with interval > 0 should appear.
2521 require .NoError (t , store .db .Create (& MaintenanceItem {
2622 Name : "With Interval" , CategoryID : cat .ID ,
@@ -43,10 +39,6 @@ func TestListMaintenanceWithScheduleDueDate(t *testing.T) {
4339 cat := MaintenanceCategory {Name : "DueDateCat" }
4440 require .NoError (t , store .db .Create (& cat ).Error )
4541
46- ptrTime := func (y , m , d int ) * time.Time {
47- t := time .Date (y , time .Month (m ), d , 0 , 0 , 0 , 0 , time .UTC )
48- return & t
49- }
5042 // Item with due date (no interval) should appear.
5143 require .NoError (t , store .db .Create (& MaintenanceItem {
5244 Name : "With DueDate" , CategoryID : cat .ID ,
@@ -204,10 +196,6 @@ func TestListExpiringWarranties(t *testing.T) {
204196 t .Parallel ()
205197 store := newTestStore (t )
206198 now := time .Date (2026 , 2 , 8 , 0 , 0 , 0 , 0 , time .UTC )
207- ptrTime := func (y , m , d int ) * time.Time {
208- t := time .Date (y , time .Month (m ), d , 0 , 0 , 0 , 0 , time .UTC )
209- return & t
210- }
211199 // Expiring in 30 days -- should appear.
212200 require .NoError (
213201 t ,
@@ -261,7 +249,6 @@ func TestListRecentServiceLogs(t *testing.T) {
261249func TestYTDSpending (t * testing.T ) {
262250 t .Parallel ()
263251 store := newTestStore (t )
264- ptr := func (v int64 ) * int64 { return & v }
265252
266253 cat := MaintenanceCategory {Name : "SpendCat" }
267254 require .NoError (t , store .db .Create (& cat ).Error )
@@ -272,13 +259,13 @@ func TestYTDSpending(t *testing.T) {
272259 require .NoError (t , store .db .Create (& ServiceLogEntry {
273260 MaintenanceItemID : item .ID ,
274261 ServicedAt : time .Date (2026 , 1 , 15 , 0 , 0 , 0 , 0 , time .UTC ),
275- CostCents : ptr ( 5000 ),
262+ CostCents : new ( int64 ( 5000 ) ),
276263 }).Error )
277264 // Last year -- should not count.
278265 require .NoError (t , store .db .Create (& ServiceLogEntry {
279266 MaintenanceItemID : item .ID ,
280267 ServicedAt : time .Date (2025 , 12 , 1 , 0 , 0 , 0 , 0 , time .UTC ),
281- CostCents : ptr ( 9999 ),
268+ CostCents : new ( int64 ( 9999 ) ),
282269 }).Error )
283270
284271 yearStart := time .Date (2026 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )
@@ -292,16 +279,16 @@ func TestYTDSpending(t *testing.T) {
292279 require .NoError (t , store .db .First (& pt ).Error )
293280 require .NoError (t , store .db .Create (& Project {
294281 Title : "P1" , ProjectTypeID : pt .ID , Status : ProjectStatusCompleted ,
295- ActualCents : ptr ( 20000 ),
282+ ActualCents : new ( int64 ( 20000 ) ),
296283 }).Error )
297284 require .NoError (t , store .db .Create (& Project {
298285 Title : "P2" , ProjectTypeID : pt .ID , Status : ProjectStatusInProgress ,
299- ActualCents : ptr ( 10000 ),
286+ ActualCents : new ( int64 ( 10000 ) ),
300287 }).Error )
301288 // Project updated last year — still included (no date filter).
302289 oldProj := Project {
303290 Title : "P3" , ProjectTypeID : pt .ID , Status : ProjectStatusCompleted ,
304- ActualCents : ptr ( 7777 ),
291+ ActualCents : new ( int64 ( 7777 ) ),
305292 }
306293 require .NoError (t , store .db .Create (& oldProj ).Error )
307294 require .NoError (t , store .db .Exec (
@@ -320,13 +307,12 @@ func TestTotalProjectSpendUnaffectedByEdits(t *testing.T) {
320307 // not change the spending total. The old updated_at filter caused edits
321308 // to inflate/deflate the YTD figure.
322309 store := newTestStore (t )
323- ptr := func (v int64 ) * int64 { return & v }
324310
325311 var pt ProjectType
326312 require .NoError (t , store .db .First (& pt ).Error )
327313 p := Project {
328314 Title : "Kitchen Remodel" , ProjectTypeID : pt .ID ,
329- Status : ProjectStatusCompleted , ActualCents : ptr ( 50000 ),
315+ Status : ProjectStatusCompleted , ActualCents : new ( int64 ( 50000 ) ),
330316 }
331317 require .NoError (t , store .db .Create (& p ).Error )
332318
0 commit comments