2024-06-05 00:24:53 +07:00

27 lines
1.1 KiB
Go

package entity
import (
"github.com/google/uuid"
"gorm.io/datatypes"
"time"
)
type Payment struct {
ID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4();primaryKey;column:id"`
PartnerID int64 `gorm:"type:numeric;not null;column:partner_id"`
OrderID int64 `gorm:"type:numeric;not null;column:order_id"`
ReferenceID string `gorm:"type:varchar;not null;column:reference_id"`
Channel string `gorm:"type:varchar;not null;column:channel"`
PaymentType string `gorm:"type:varchar;not null;column:payment_type"`
Amount float64 `gorm:"type:numeric;not null;column:amount"`
State string `gorm:"type:varchar;not null;column:state"`
RequestMetadata datatypes.JSON `gorm:"type:json;not null;column:request_metadata"`
CreatedAt time.Time `gorm:"autoCreateTime;column:created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime;column:updated_at"`
FinishedAt time.Time `gorm:"column:finished_at"`
}
func (Payment) TableName() string {
return "payments"
}