107 lines
6.7 KiB
Go
107 lines
6.7 KiB
Go
|
// Code generated by ent, DO NOT EDIT.
|
||
|
|
||
|
package ent
|
||
|
|
||
|
import (
|
||
|
"tel-commerce/ent/business"
|
||
|
"tel-commerce/ent/businesscategory"
|
||
|
"tel-commerce/ent/product"
|
||
|
"tel-commerce/ent/productcategory"
|
||
|
"tel-commerce/ent/schema"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
// The init function reads all schema descriptors with runtime code
|
||
|
// (default values, validators, hooks and policies) and stitches it
|
||
|
// to their package variables.
|
||
|
func init() {
|
||
|
businessFields := schema.Business{}.Fields()
|
||
|
_ = businessFields
|
||
|
// businessDescName is the schema descriptor for name field.
|
||
|
businessDescName := businessFields[0].Descriptor()
|
||
|
// business.DefaultName holds the default value on creation for the name field.
|
||
|
business.DefaultName = businessDescName.Default.(string)
|
||
|
// businessDescCompany is the schema descriptor for company field.
|
||
|
businessDescCompany := businessFields[4].Descriptor()
|
||
|
// business.DefaultCompany holds the default value on creation for the company field.
|
||
|
business.DefaultCompany = businessDescCompany.Default.(string)
|
||
|
// businessDescCreatedAt is the schema descriptor for created_at field.
|
||
|
businessDescCreatedAt := businessFields[6].Descriptor()
|
||
|
// business.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||
|
business.DefaultCreatedAt = businessDescCreatedAt.Default.(func() time.Time)
|
||
|
// businessDescUpdatedAt is the schema descriptor for updated_at field.
|
||
|
businessDescUpdatedAt := businessFields[7].Descriptor()
|
||
|
// business.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||
|
business.DefaultUpdatedAt = businessDescUpdatedAt.Default.(func() time.Time)
|
||
|
// business.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||
|
business.UpdateDefaultUpdatedAt = businessDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||
|
businesscategoryFields := schema.BusinessCategory{}.Fields()
|
||
|
_ = businesscategoryFields
|
||
|
// businesscategoryDescName is the schema descriptor for name field.
|
||
|
businesscategoryDescName := businesscategoryFields[1].Descriptor()
|
||
|
// businesscategory.DefaultName holds the default value on creation for the name field.
|
||
|
businesscategory.DefaultName = businesscategoryDescName.Default.(string)
|
||
|
// businesscategoryDescDescription is the schema descriptor for description field.
|
||
|
businesscategoryDescDescription := businesscategoryFields[2].Descriptor()
|
||
|
// businesscategory.DefaultDescription holds the default value on creation for the description field.
|
||
|
businesscategory.DefaultDescription = businesscategoryDescDescription.Default.(string)
|
||
|
productFields := schema.Product{}.Fields()
|
||
|
_ = productFields
|
||
|
// productDescName is the schema descriptor for name field.
|
||
|
productDescName := productFields[0].Descriptor()
|
||
|
// product.DefaultName holds the default value on creation for the name field.
|
||
|
product.DefaultName = productDescName.Default.(string)
|
||
|
// productDescPrice is the schema descriptor for price field.
|
||
|
productDescPrice := productFields[2].Descriptor()
|
||
|
// product.DefaultPrice holds the default value on creation for the price field.
|
||
|
product.DefaultPrice = productDescPrice.Default.(float64)
|
||
|
// product.PriceValidator is a validator for the "price" field. It is called by the builders before save.
|
||
|
product.PriceValidator = productDescPrice.Validators[0].(func(float64) error)
|
||
|
// productDescOriginalPrice is the schema descriptor for original_price field.
|
||
|
productDescOriginalPrice := productFields[3].Descriptor()
|
||
|
// product.DefaultOriginalPrice holds the default value on creation for the original_price field.
|
||
|
product.DefaultOriginalPrice = productDescOriginalPrice.Default.(float64)
|
||
|
// product.OriginalPriceValidator is a validator for the "original_price" field. It is called by the builders before save.
|
||
|
product.OriginalPriceValidator = productDescOriginalPrice.Validators[0].(func(float64) error)
|
||
|
// productDescQuantity is the schema descriptor for quantity field.
|
||
|
productDescQuantity := productFields[4].Descriptor()
|
||
|
// product.DefaultQuantity holds the default value on creation for the quantity field.
|
||
|
product.DefaultQuantity = productDescQuantity.Default.(int)
|
||
|
// product.QuantityValidator is a validator for the "quantity" field. It is called by the builders before save.
|
||
|
product.QuantityValidator = productDescQuantity.Validators[0].(func(int) error)
|
||
|
// productDescStatus is the schema descriptor for status field.
|
||
|
productDescStatus := productFields[5].Descriptor()
|
||
|
// product.DefaultStatus holds the default value on creation for the status field.
|
||
|
product.DefaultStatus = productDescStatus.Default.(bool)
|
||
|
// productDescCreatedAt is the schema descriptor for created_at field.
|
||
|
productDescCreatedAt := productFields[6].Descriptor()
|
||
|
// product.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||
|
product.DefaultCreatedAt = productDescCreatedAt.Default.(time.Time)
|
||
|
// productDescUpdatedAt is the schema descriptor for updated_at field.
|
||
|
productDescUpdatedAt := productFields[7].Descriptor()
|
||
|
// product.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||
|
product.DefaultUpdatedAt = productDescUpdatedAt.Default.(time.Time)
|
||
|
// product.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||
|
product.UpdateDefaultUpdatedAt = productDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||
|
productcategoryFields := schema.ProductCategory{}.Fields()
|
||
|
_ = productcategoryFields
|
||
|
// productcategoryDescName is the schema descriptor for name field.
|
||
|
productcategoryDescName := productcategoryFields[0].Descriptor()
|
||
|
// productcategory.DefaultName holds the default value on creation for the name field.
|
||
|
productcategory.DefaultName = productcategoryDescName.Default.(string)
|
||
|
// productcategoryDescStatus is the schema descriptor for status field.
|
||
|
productcategoryDescStatus := productcategoryFields[3].Descriptor()
|
||
|
// productcategory.DefaultStatus holds the default value on creation for the status field.
|
||
|
productcategory.DefaultStatus = productcategoryDescStatus.Default.(bool)
|
||
|
// productcategoryDescCreatedAt is the schema descriptor for created_at field.
|
||
|
productcategoryDescCreatedAt := productcategoryFields[4].Descriptor()
|
||
|
// productcategory.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||
|
productcategory.DefaultCreatedAt = productcategoryDescCreatedAt.Default.(time.Time)
|
||
|
// productcategoryDescUpdatedAt is the schema descriptor for updated_at field.
|
||
|
productcategoryDescUpdatedAt := productcategoryFields[5].Descriptor()
|
||
|
// productcategory.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||
|
productcategory.DefaultUpdatedAt = productcategoryDescUpdatedAt.Default.(time.Time)
|
||
|
// productcategory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||
|
productcategory.UpdateDefaultUpdatedAt = productcategoryDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||
|
}
|