-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_types.go
More file actions
35 lines (31 loc) · 1.04 KB
/
test_types.go
File metadata and controls
35 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//go:build integration
package db
import "time"
// Define test models that match the schema in default.sql
type Product struct {
ID string `gorm:"primaryKey;type:uuid"`
Name string `gorm:"not null"`
Description string
Category string `gorm:"not null"`
Price float64 `gorm:"not null"`
StockQuantity int `gorm:"not null"`
WeightKg float64
Dimensions string
IsAvailable bool `gorm:"default:true"`
CreatedAt time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`
UpdatedAt time.Time
}
type Customer struct {
ID string `gorm:"primaryKey;type:uuid"`
FirstName string `gorm:"not null"`
LastName string `gorm:"not null"`
Email string `gorm:"unique;not null"`
Phone string
Address string
City string
Country string
PostalCode string
IsActive bool `gorm:"default:true"`
LoyaltyPoints int `gorm:"default:0"`
RegistrationDate time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`
}