github.com/NpoolPlatform/chain-middleware@v0.0.0-20240228100535-eb1bcf896eb9/pkg/db/ent/schema/fiat.go (about)

     1  package schema
     2  
     3  import (
     4  	"entgo.io/ent"
     5  	"entgo.io/ent/schema/field"
     6  	"github.com/NpoolPlatform/chain-middleware/pkg/db/mixin"
     7  	crudermixin "github.com/NpoolPlatform/libent-cruder/pkg/mixin"
     8  )
     9  
    10  // Fiat holds the schema definition for the Fiat entity.
    11  type Fiat struct {
    12  	ent.Schema
    13  }
    14  
    15  func (Fiat) Mixin() []ent.Mixin {
    16  	return []ent.Mixin{
    17  		mixin.TimeMixin{},
    18  		crudermixin.AutoIDMixin{},
    19  	}
    20  }
    21  
    22  // Fields of the Fiat.
    23  func (Fiat) Fields() []ent.Field {
    24  	return []ent.Field{
    25  		field.
    26  			String("name").
    27  			Optional().
    28  			Default(""),
    29  		field.
    30  			String("logo").
    31  			Optional().
    32  			Default(""),
    33  		field.
    34  			String("unit").
    35  			Optional().
    36  			Default(""),
    37  	}
    38  }
    39  
    40  // Edges of the Fiat.
    41  func (Fiat) Edges() []ent.Edge {
    42  	return nil
    43  }