// Code generated by entc, DO NOT EDIT.

package ent

import (
	"time"

	"github.com/pingcap/test-infra/common/model"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/casetriage"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/resourceduration"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/schema"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/testbedinfo"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/triage"
)

// 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() {
	casetriageMixin := schema.CaseTriage{}.Mixin()
	casetriageMixinFields1 := casetriageMixin[1].Fields()
	_ = casetriageMixinFields1
	casetriageFields := schema.CaseTriage{}.Fields()
	_ = casetriageFields
	// casetriageDescCreatedAt is the schema descriptor for createdAt field.
	casetriageDescCreatedAt := casetriageMixinFields1[0].Descriptor()
	// casetriage.DefaultCreatedAt holds the default value on creation for the createdAt field.
	casetriage.DefaultCreatedAt = casetriageDescCreatedAt.Default.(func() time.Time)
	// casetriageDescUpdatedAt is the schema descriptor for updatedAt field.
	casetriageDescUpdatedAt := casetriageMixinFields1[1].Descriptor()
	// casetriage.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
	casetriage.DefaultUpdatedAt = casetriageDescUpdatedAt.Default.(func() time.Time)
	// casetriage.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
	casetriage.UpdateDefaultUpdatedAt = casetriageDescUpdatedAt.UpdateDefault.(func() time.Time)
	// casetriageDescPlanExecutionID is the schema descriptor for planExecutionID field.
	casetriageDescPlanExecutionID := casetriageFields[0].Descriptor()
	// casetriage.PlanExecutionIDValidator is a validator for the "planExecutionID" field. It is called by the builders before save.
	casetriage.PlanExecutionIDValidator = casetriageDescPlanExecutionID.Validators[0].(func(uint64) error)
	// casetriageDescPlanID is the schema descriptor for planID field.
	casetriageDescPlanID := casetriageFields[1].Descriptor()
	// casetriage.PlanIDValidator is a validator for the "planID" field. It is called by the builders before save.
	casetriage.PlanIDValidator = casetriageDescPlanID.Validators[0].(func(uint64) error)
	// casetriageDescCaseExecutionID is the schema descriptor for caseExecutionID field.
	casetriageDescCaseExecutionID := casetriageFields[2].Descriptor()
	// casetriage.CaseExecutionIDValidator is a validator for the "caseExecutionID" field. It is called by the builders before save.
	casetriage.CaseExecutionIDValidator = casetriageDescCaseExecutionID.Validators[0].(func(uint64) error)
	// casetriageDescCaseID is the schema descriptor for caseID field.
	casetriageDescCaseID := casetriageFields[3].Descriptor()
	// casetriage.CaseIDValidator is a validator for the "caseID" field. It is called by the builders before save.
	casetriage.CaseIDValidator = casetriageDescCaseID.Validators[0].(func(uint64) error)
	// casetriageDescIssueLink is the schema descriptor for issueLink field.
	casetriageDescIssueLink := casetriageFields[6].Descriptor()
	// casetriage.DefaultIssueLink holds the default value on creation for the issueLink field.
	casetriage.DefaultIssueLink = casetriageDescIssueLink.Default.(string)
	// casetriage.IssueLinkValidator is a validator for the "issueLink" field. It is called by the builders before save.
	casetriage.IssueLinkValidator = casetriageDescIssueLink.Validators[0].(func(string) error)
	// casetriageDescNote is the schema descriptor for note field.
	casetriageDescNote := casetriageFields[7].Descriptor()
	// casetriage.DefaultNote holds the default value on creation for the note field.
	casetriage.DefaultNote = casetriageDescNote.Default.(string)
	// casetriage.NoteValidator is a validator for the "note" field. It is called by the builders before save.
	casetriage.NoteValidator = casetriageDescNote.Validators[0].(func(string) error)
	// casetriageDescForkedFrom is the schema descriptor for forkedFrom field.
	casetriageDescForkedFrom := casetriageFields[8].Descriptor()
	// casetriage.DefaultForkedFrom holds the default value on creation for the forkedFrom field.
	casetriage.DefaultForkedFrom = model.ID(casetriageDescForkedFrom.Default.(uint64))
	resourcedurationMixin := schema.ResourceDuration{}.Mixin()
	resourcedurationMixinFields1 := resourcedurationMixin[1].Fields()
	_ = resourcedurationMixinFields1
	resourcedurationFields := schema.ResourceDuration{}.Fields()
	_ = resourcedurationFields
	// resourcedurationDescCreatedAt is the schema descriptor for createdAt field.
	resourcedurationDescCreatedAt := resourcedurationMixinFields1[0].Descriptor()
	// resourceduration.DefaultCreatedAt holds the default value on creation for the createdAt field.
	resourceduration.DefaultCreatedAt = resourcedurationDescCreatedAt.Default.(func() time.Time)
	// resourcedurationDescUpdatedAt is the schema descriptor for updatedAt field.
	resourcedurationDescUpdatedAt := resourcedurationMixinFields1[1].Descriptor()
	// resourceduration.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
	resourceduration.DefaultUpdatedAt = resourcedurationDescUpdatedAt.Default.(func() time.Time)
	// resourceduration.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
	resourceduration.UpdateDefaultUpdatedAt = resourcedurationDescUpdatedAt.UpdateDefault.(func() time.Time)
	// resourcedurationDescPlanExecutionID is the schema descriptor for planExecutionID field.
	resourcedurationDescPlanExecutionID := resourcedurationFields[0].Descriptor()
	// resourceduration.PlanExecutionIDValidator is a validator for the "planExecutionID" field. It is called by the builders before save.
	resourceduration.PlanExecutionIDValidator = resourcedurationDescPlanExecutionID.Validators[0].(func(uint64) error)
	testbedinfoMixin := schema.TestbedInfo{}.Mixin()
	testbedinfoMixinFields1 := testbedinfoMixin[1].Fields()
	_ = testbedinfoMixinFields1
	testbedinfoFields := schema.TestbedInfo{}.Fields()
	_ = testbedinfoFields
	// testbedinfoDescCreatedAt is the schema descriptor for createdAt field.
	testbedinfoDescCreatedAt := testbedinfoMixinFields1[0].Descriptor()
	// testbedinfo.DefaultCreatedAt holds the default value on creation for the createdAt field.
	testbedinfo.DefaultCreatedAt = testbedinfoDescCreatedAt.Default.(func() time.Time)
	// testbedinfoDescUpdatedAt is the schema descriptor for updatedAt field.
	testbedinfoDescUpdatedAt := testbedinfoMixinFields1[1].Descriptor()
	// testbedinfo.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
	testbedinfo.DefaultUpdatedAt = testbedinfoDescUpdatedAt.Default.(func() time.Time)
	// testbedinfo.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
	testbedinfo.UpdateDefaultUpdatedAt = testbedinfoDescUpdatedAt.UpdateDefault.(func() time.Time)
	// testbedinfoDescName is the schema descriptor for name field.
	testbedinfoDescName := testbedinfoFields[0].Descriptor()
	// testbedinfo.NameValidator is a validator for the "name" field. It is called by the builders before save.
	testbedinfo.NameValidator = func() func(string) error {
		validators := testbedinfoDescName.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(name string) error {
			for _, fn := range fns {
				if err := fn(name); err != nil {
					return err
				}
			}
			return nil
		}
	}()
	// testbedinfoDescPlanExecutionID is the schema descriptor for planExecutionID field.
	testbedinfoDescPlanExecutionID := testbedinfoFields[2].Descriptor()
	// testbedinfo.PlanExecutionIDValidator is a validator for the "planExecutionID" field. It is called by the builders before save.
	testbedinfo.PlanExecutionIDValidator = testbedinfoDescPlanExecutionID.Validators[0].(func(uint64) error)
	// testbedinfoDescURL is the schema descriptor for url field.
	testbedinfoDescURL := testbedinfoFields[3].Descriptor()
	// testbedinfo.DefaultURL holds the default value on creation for the url field.
	testbedinfo.DefaultURL = testbedinfoDescURL.Default.(string)
	// testbedinfoDescSetUpLogURL is the schema descriptor for setUpLogURL field.
	testbedinfoDescSetUpLogURL := testbedinfoFields[11].Descriptor()
	// testbedinfo.DefaultSetUpLogURL holds the default value on creation for the setUpLogURL field.
	testbedinfo.DefaultSetUpLogURL = testbedinfoDescSetUpLogURL.Default.(string)
	// testbedinfoDescResourcePoolID is the schema descriptor for resourcePoolID field.
	testbedinfoDescResourcePoolID := testbedinfoFields[12].Descriptor()
	// testbedinfo.ResourcePoolIDValidator is a validator for the "resourcePoolID" field. It is called by the builders before save.
	testbedinfo.ResourcePoolIDValidator = testbedinfoDescResourcePoolID.Validators[0].(func(uint64) error)
	triageMixin := schema.Triage{}.Mixin()
	triageMixinFields1 := triageMixin[1].Fields()
	_ = triageMixinFields1
	triageFields := schema.Triage{}.Fields()
	_ = triageFields
	// triageDescCreatedAt is the schema descriptor for createdAt field.
	triageDescCreatedAt := triageMixinFields1[0].Descriptor()
	// triage.DefaultCreatedAt holds the default value on creation for the createdAt field.
	triage.DefaultCreatedAt = triageDescCreatedAt.Default.(func() time.Time)
	// triageDescUpdatedAt is the schema descriptor for updatedAt field.
	triageDescUpdatedAt := triageMixinFields1[1].Descriptor()
	// triage.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
	triage.DefaultUpdatedAt = triageDescUpdatedAt.Default.(func() time.Time)
	// triage.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
	triage.UpdateDefaultUpdatedAt = triageDescUpdatedAt.UpdateDefault.(func() time.Time)
	// triageDescPlanExecutionID is the schema descriptor for planExecutionID field.
	triageDescPlanExecutionID := triageFields[0].Descriptor()
	// triage.PlanExecutionIDValidator is a validator for the "planExecutionID" field. It is called by the builders before save.
	triage.PlanExecutionIDValidator = triageDescPlanExecutionID.Validators[0].(func(uint64) error)
	// triageDescPlanID is the schema descriptor for planID field.
	triageDescPlanID := triageFields[1].Descriptor()
	// triage.PlanIDValidator is a validator for the "planID" field. It is called by the builders before save.
	triage.PlanIDValidator = triageDescPlanID.Validators[0].(func(uint64) error)
	// triageDescTriagingUsers is the schema descriptor for triagingUsers field.
	triageDescTriagingUsers := triageFields[2].Descriptor()
	// triage.DefaultTriagingUsers holds the default value on creation for the triagingUsers field.
	triage.DefaultTriagingUsers = triageDescTriagingUsers.Default.([]model.ID)
	// triageDescToTriageCaseExecIDs is the schema descriptor for toTriageCaseExecIDs field.
	triageDescToTriageCaseExecIDs := triageFields[3].Descriptor()
	// triage.DefaultToTriageCaseExecIDs holds the default value on creation for the toTriageCaseExecIDs field.
	triage.DefaultToTriageCaseExecIDs = triageDescToTriageCaseExecIDs.Default.([]model.ID)
	// triageDescTriagedCaseExecIDs is the schema descriptor for triagedCaseExecIDs field.
	triageDescTriagedCaseExecIDs := triageFields[4].Descriptor()
	// triage.DefaultTriagedCaseExecIDs holds the default value on creation for the triagedCaseExecIDs field.
	triage.DefaultTriagedCaseExecIDs = triageDescTriagedCaseExecIDs.Default.([]model.ID)
	// triageDescReasons is the schema descriptor for reasons field.
	triageDescReasons := triageFields[8].Descriptor()
	// triage.DefaultReasons holds the default value on creation for the reasons field.
	triage.DefaultReasons = triageDescReasons.Default.([]model.CaseExecFailReason)
	// triageDescNote is the schema descriptor for note field.
	triageDescNote := triageFields[10].Descriptor()
	// triage.DefaultNote holds the default value on creation for the note field.
	triage.DefaultNote = triageDescNote.Default.(string)
	// triage.NoteValidator is a validator for the "note" field. It is called by the builders before save.
	triage.NoteValidator = triageDescNote.Validators[0].(func(string) error)
}
