//
// 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 ProductItem = newProductItemTable("payments", "product_item", "")

type productItemTable struct {
	postgres.Table

	// Columns
	ProductID postgres.ColumnString
	AtomType  postgres.ColumnString
	Quantity  postgres.ColumnInteger

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

type ProductItemTable struct {
	productItemTable

	EXCLUDED productItemTable
}

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

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

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

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

func newProductItemTable(schemaName, tableName, alias string) *ProductItemTable {
	return &ProductItemTable{
		productItemTable: newProductItemTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newProductItemTableImpl("", "excluded", ""),
	}
}

func newProductItemTableImpl(schemaName, tableName, alias string) productItemTable {
	var (
		ProductIDColumn = postgres.StringColumn("product_id")
		AtomTypeColumn  = postgres.StringColumn("atom_type")
		QuantityColumn  = postgres.IntegerColumn("quantity")
		allColumns      = postgres.ColumnList{ProductIDColumn, AtomTypeColumn, QuantityColumn}
		mutableColumns  = postgres.ColumnList{QuantityColumn}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		ProductID: ProductIDColumn,
		AtomType:  AtomTypeColumn,
		Quantity:  QuantityColumn,

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