//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/go-jet/jet/v2/postgres"
)

var EntitlementRecords = newEntitlementRecordsTable("backend", "entitlement_records", "")

type entitlementRecordsTable struct {
	postgres.Table

	// Columns
	RecordID      postgres.ColumnString
	UserID        postgres.ColumnString
	Tier          postgres.ColumnString
	IsPaid        postgres.ColumnBool
	Source        postgres.ColumnString
	ActorType     postgres.ColumnString
	ActorUserID   postgres.ColumnString
	ActorUsername postgres.ColumnString
	ReasonCode    postgres.ColumnString
	StartsAt      postgres.ColumnTimestampz
	EndsAt        postgres.ColumnTimestampz
	CreatedAt     postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type EntitlementRecordsTable struct {
	entitlementRecordsTable

	EXCLUDED entitlementRecordsTable
}

// AS creates new EntitlementRecordsTable with assigned alias
func (a EntitlementRecordsTable) AS(alias string) *EntitlementRecordsTable {
	return newEntitlementRecordsTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new EntitlementRecordsTable with assigned schema name
func (a EntitlementRecordsTable) FromSchema(schemaName string) *EntitlementRecordsTable {
	return newEntitlementRecordsTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new EntitlementRecordsTable with assigned table prefix
func (a EntitlementRecordsTable) WithPrefix(prefix string) *EntitlementRecordsTable {
	return newEntitlementRecordsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new EntitlementRecordsTable with assigned table suffix
func (a EntitlementRecordsTable) WithSuffix(suffix string) *EntitlementRecordsTable {
	return newEntitlementRecordsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newEntitlementRecordsTable(schemaName, tableName, alias string) *EntitlementRecordsTable {
	return &EntitlementRecordsTable{
		entitlementRecordsTable: newEntitlementRecordsTableImpl(schemaName, tableName, alias),
		EXCLUDED:                newEntitlementRecordsTableImpl("", "excluded", ""),
	}
}

func newEntitlementRecordsTableImpl(schemaName, tableName, alias string) entitlementRecordsTable {
	var (
		RecordIDColumn      = postgres.StringColumn("record_id")
		UserIDColumn        = postgres.StringColumn("user_id")
		TierColumn          = postgres.StringColumn("tier")
		IsPaidColumn        = postgres.BoolColumn("is_paid")
		SourceColumn        = postgres.StringColumn("source")
		ActorTypeColumn     = postgres.StringColumn("actor_type")
		ActorUserIDColumn   = postgres.StringColumn("actor_user_id")
		ActorUsernameColumn = postgres.StringColumn("actor_username")
		ReasonCodeColumn    = postgres.StringColumn("reason_code")
		StartsAtColumn      = postgres.TimestampzColumn("starts_at")
		EndsAtColumn        = postgres.TimestampzColumn("ends_at")
		CreatedAtColumn     = postgres.TimestampzColumn("created_at")
		allColumns          = postgres.ColumnList{RecordIDColumn, UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
		mutableColumns      = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
		defaultColumns      = postgres.ColumnList{ReasonCodeColumn, StartsAtColumn, CreatedAtColumn}
	)

	return entitlementRecordsTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		RecordID:      RecordIDColumn,
		UserID:        UserIDColumn,
		Tier:          TierColumn,
		IsPaid:        IsPaidColumn,
		Source:        SourceColumn,
		ActorType:     ActorTypeColumn,
		ActorUserID:   ActorUserIDColumn,
		ActorUsername: ActorUsernameColumn,
		ReasonCode:    ReasonCodeColumn,
		StartsAt:      StartsAtColumn,
		EndsAt:        EndsAtColumn,
		CreatedAt:     CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
