2023-10-27 09:51:58 +00:00
|
|
|
// Code generated by ent, DO NOT EDIT.
|
|
|
|
|
|
|
|
package ent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"online-order/ent/business"
|
|
|
|
"online-order/ent/businesscategory"
|
2023-10-28 23:12:07 +00:00
|
|
|
"online-order/ent/businessconfig"
|
|
|
|
"online-order/ent/domain"
|
2023-10-27 09:51:58 +00:00
|
|
|
"online-order/ent/product"
|
|
|
|
"online-order/ent/productcategory"
|
|
|
|
"online-order/ent/schema"
|
2023-10-28 23:12:07 +00:00
|
|
|
"online-order/ent/user"
|
2023-10-27 09:51:58 +00:00
|
|
|
"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)
|
|
|
|
// businessDescCreatedAt is the schema descriptor for created_at field.
|
2023-10-28 23:12:07 +00:00
|
|
|
businessDescCreatedAt := businessFields[7].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
businessDescUpdatedAt := businessFields[8].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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)
|
2023-10-28 23:12:07 +00:00
|
|
|
businessconfigFields := schema.BusinessConfig{}.Fields()
|
|
|
|
_ = businessconfigFields
|
|
|
|
// businessconfigDescCompany is the schema descriptor for company field.
|
|
|
|
businessconfigDescCompany := businessconfigFields[0].Descriptor()
|
|
|
|
// businessconfig.DefaultCompany holds the default value on creation for the company field.
|
|
|
|
businessconfig.DefaultCompany = businessconfigDescCompany.Default.(string)
|
|
|
|
domainFields := schema.Domain{}.Fields()
|
|
|
|
_ = domainFields
|
2023-10-29 23:33:40 +00:00
|
|
|
// domainDescStatus is the schema descriptor for status field.
|
|
|
|
domainDescStatus := domainFields[4].Descriptor()
|
|
|
|
// domain.DefaultStatus holds the default value on creation for the status field.
|
|
|
|
domain.DefaultStatus = domainDescStatus.Default.(bool)
|
2023-10-28 23:12:07 +00:00
|
|
|
// domainDescCreatedAt is the schema descriptor for created_at field.
|
2023-10-29 23:33:40 +00:00
|
|
|
domainDescCreatedAt := domainFields[5].Descriptor()
|
2023-10-28 23:12:07 +00:00
|
|
|
// domain.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
|
|
domain.DefaultCreatedAt = domainDescCreatedAt.Default.(func() time.Time)
|
|
|
|
// domainDescUpdatedAt is the schema descriptor for updated_at field.
|
2023-10-29 23:33:40 +00:00
|
|
|
domainDescUpdatedAt := domainFields[6].Descriptor()
|
2023-10-28 23:12:07 +00:00
|
|
|
// domain.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
|
|
domain.DefaultUpdatedAt = domainDescUpdatedAt.Default.(func() time.Time)
|
|
|
|
// domain.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
|
|
|
domain.UpdateDefaultUpdatedAt = domainDescUpdatedAt.UpdateDefault.(func() time.Time)
|
2023-10-27 09:51:58 +00:00
|
|
|
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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescPrice := productFields[3].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescOriginalPrice := productFields[4].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescQuantity := productFields[5].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescStatus := productFields[6].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescCreatedAt := productFields[10].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productDescUpdatedAt := productFields[11].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productcategoryDescCreatedAt := productcategoryFields[5].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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.
|
2023-10-28 23:12:07 +00:00
|
|
|
productcategoryDescUpdatedAt := productcategoryFields[6].Descriptor()
|
2023-10-27 09:51:58 +00:00
|
|
|
// 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)
|
2023-10-28 23:12:07 +00:00
|
|
|
userFields := schema.User{}.Fields()
|
|
|
|
_ = userFields
|
|
|
|
// userDescEmail is the schema descriptor for email field.
|
|
|
|
userDescEmail := userFields[0].Descriptor()
|
|
|
|
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
|
|
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
|
|
|
|
// userDescFirstName is the schema descriptor for first_name field.
|
|
|
|
userDescFirstName := userFields[2].Descriptor()
|
|
|
|
// user.FirstNameValidator is a validator for the "first_name" field. It is called by the builders before save.
|
|
|
|
user.FirstNameValidator = userDescFirstName.Validators[0].(func(string) error)
|
|
|
|
// userDescLastName is the schema descriptor for last_name field.
|
|
|
|
userDescLastName := userFields[3].Descriptor()
|
|
|
|
// user.LastNameValidator is a validator for the "last_name" field. It is called by the builders before save.
|
|
|
|
user.LastNameValidator = userDescLastName.Validators[0].(func(string) error)
|
|
|
|
// userDescIsActive is the schema descriptor for is_active field.
|
|
|
|
userDescIsActive := userFields[5].Descriptor()
|
|
|
|
// user.DefaultIsActive holds the default value on creation for the is_active field.
|
|
|
|
user.DefaultIsActive = userDescIsActive.Default.(bool)
|
|
|
|
// userDescIsAdmin is the schema descriptor for is_admin field.
|
|
|
|
userDescIsAdmin := userFields[6].Descriptor()
|
|
|
|
// user.DefaultIsAdmin holds the default value on creation for the is_admin field.
|
|
|
|
user.DefaultIsAdmin = userDescIsAdmin.Default.(bool)
|
|
|
|
// userDescCreatedAt is the schema descriptor for created_at field.
|
|
|
|
userDescCreatedAt := userFields[7].Descriptor()
|
|
|
|
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
|
|
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
|
|
|
|
// userDescUpdatedAt is the schema descriptor for updated_at field.
|
|
|
|
userDescUpdatedAt := userFields[8].Descriptor()
|
|
|
|
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
|
|
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
|
|
|
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
|
|
|
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
|
2023-10-27 09:51:58 +00:00
|
|
|
}
|