//
// 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/Gleipnir-Technology/jet/postgres"
)

var NotifyPhone = newNotifyPhoneTable("publicreport", "notify_phone", "")

type notifyPhoneTable struct {
	postgres.Table

	// Columns
	Created   postgres.ColumnTimestamp
	Deleted   postgres.ColumnTimestamp
	PhoneE164 postgres.ColumnString
	ReportID  postgres.ColumnInteger

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

type NotifyPhoneTable struct {
	notifyPhoneTable

	EXCLUDED notifyPhoneTable
}

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

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

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

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

func newNotifyPhoneTable(schemaName, tableName, alias string) *NotifyPhoneTable {
	return &NotifyPhoneTable{
		notifyPhoneTable: newNotifyPhoneTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newNotifyPhoneTableImpl("", "excluded", ""),
	}
}

func newNotifyPhoneTableImpl(schemaName, tableName, alias string) notifyPhoneTable {
	var (
		CreatedColumn   = postgres.TimestampColumn("created")
		DeletedColumn   = postgres.TimestampColumn("deleted")
		PhoneE164Column = postgres.StringColumn("phone_e164")
		ReportIDColumn  = postgres.IntegerColumn("report_id")
		allColumns      = postgres.ColumnList{CreatedColumn, DeletedColumn, PhoneE164Column, ReportIDColumn}
		mutableColumns  = postgres.ColumnList{CreatedColumn, DeletedColumn}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		Created:   CreatedColumn,
		Deleted:   DeletedColumn,
		PhoneE164: PhoneE164Column,
		ReportID:  ReportIDColumn,

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