szabadpalya/api/internal/store/dbgen/models.go

312 lines
6.6 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package dbgen
import (
"database/sql/driver"
"fmt"
"time"
)
type CampaignStatus string
const (
CampaignStatusDRAFT CampaignStatus = "DRAFT"
CampaignStatusBEADVA CampaignStatus = "BEADVA"
CampaignStatusAKTIV CampaignStatus = "AKTIV"
CampaignStatusFINANSZIROZOTT CampaignStatus = "FINANSZIROZOTT"
CampaignStatusLEZART CampaignStatus = "LEZART"
CampaignStatusELUTASITVA CampaignStatus = "ELUTASITVA"
)
func (e *CampaignStatus) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = CampaignStatus(s)
case string:
*e = CampaignStatus(s)
default:
return fmt.Errorf("unsupported scan type for CampaignStatus: %T", src)
}
return nil
}
type NullCampaignStatus struct {
CampaignStatus CampaignStatus
Valid bool // Valid is true if CampaignStatus is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCampaignStatus) Scan(value interface{}) error {
if value == nil {
ns.CampaignStatus, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.CampaignStatus.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCampaignStatus) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.CampaignStatus), nil
}
type PhysicalTierPolicy string
const (
PhysicalTierPolicyGUARD PhysicalTierPolicy = "GUARD"
PhysicalTierPolicyIMMEDIATE PhysicalTierPolicy = "IMMEDIATE"
)
func (e *PhysicalTierPolicy) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PhysicalTierPolicy(s)
case string:
*e = PhysicalTierPolicy(s)
default:
return fmt.Errorf("unsupported scan type for PhysicalTierPolicy: %T", src)
}
return nil
}
type NullPhysicalTierPolicy struct {
PhysicalTierPolicy PhysicalTierPolicy
Valid bool // Valid is true if PhysicalTierPolicy is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPhysicalTierPolicy) Scan(value interface{}) error {
if value == nil {
ns.PhysicalTierPolicy, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PhysicalTierPolicy.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPhysicalTierPolicy) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PhysicalTierPolicy), nil
}
type PledgeStatus string
const (
PledgeStatusAUTHORIZED PledgeStatus = "AUTHORIZED"
PledgeStatusCAPTURED PledgeStatus = "CAPTURED"
PledgeStatusRELEASED PledgeStatus = "RELEASED"
PledgeStatusREFUNDED PledgeStatus = "REFUNDED"
)
func (e *PledgeStatus) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PledgeStatus(s)
case string:
*e = PledgeStatus(s)
default:
return fmt.Errorf("unsupported scan type for PledgeStatus: %T", src)
}
return nil
}
type NullPledgeStatus struct {
PledgeStatus PledgeStatus
Valid bool // Valid is true if PledgeStatus is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPledgeStatus) Scan(value interface{}) error {
if value == nil {
ns.PledgeStatus, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PledgeStatus.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPledgeStatus) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PledgeStatus), nil
}
type TierType string
const (
TierTypeDONATION TierType = "DONATION"
TierTypeDIGITAL TierType = "DIGITAL"
TierTypePHYSICAL TierType = "PHYSICAL"
)
func (e *TierType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = TierType(s)
case string:
*e = TierType(s)
default:
return fmt.Errorf("unsupported scan type for TierType: %T", src)
}
return nil
}
type NullTierType struct {
TierType TierType
Valid bool // Valid is true if TierType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullTierType) Scan(value interface{}) error {
if value == nil {
ns.TierType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.TierType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullTierType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.TierType), nil
}
type Campaign struct {
ID string
Slug string
Title string
Category string
Summary string
Art string
GoalAmount int
Currency string
StartsAt time.Time
EndsAt time.Time
Status string
PhysicalTierPolicy string
OwnerID string
CreatedAt time.Time
UpdatedAt time.Time
}
type CampaignUpdate struct {
ID string
CampaignID string
Title string
Body string
PublishedAt time.Time
}
type Comment struct {
ID string
CampaignID string
AuthorName string
Body string
CreatedAt time.Time
}
type Owner struct {
ID string
Slug string
Name string
Initials string
Location string
Blurb string
StripeAccountID *string
Approved bool
CreatedAt time.Time
AvatarUrl *string
}
type Pledge struct {
ID string
CampaignID string
TierID string
UserID *string
BackerEmail string
Quantity int
Amount int
Status string
StripePaymentIntentID *string
CreatedAt time.Time
CapturedAt *time.Time
}
type RewardTier struct {
ID string
CampaignID string
Type string
Price int
ListPrice *int
Title string
Includes []string
InventoryLimit *int
EstimatedDelivery *time.Time
Featured bool
Position int
}
type Session struct {
ID string
Token string
ExpiresAt time.Time
IpAddress *string
UserAgent *string
UserID string
CreatedAt time.Time
UpdatedAt time.Time
}
type ShippingAddress struct {
ID string
PledgeID string
Recipient string
PostalCode string
City string
Street string
Note *string
}
type StorySection struct {
ID string
CampaignID string
Heading string
Body []string
Position int
}
type User struct {
ID string
Email string
Name string
EmailVerified bool
Image *string
IsAdmin bool
CreatedAt time.Time
UpdatedAt time.Time
}
type Verification struct {
ID string
Identifier string
Value string
ExpiresAt time.Time
ConsumedAt *time.Time
CreatedAt time.Time
UpdatedAt time.Time
}