backend api, swagger, tooling, frontend skeleton

This commit is contained in:
2026-01-21 22:05:02 +01:00
parent a9d1ad79ca
commit 88624f3bed
107 changed files with 34393 additions and 6 deletions

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -45,6 +47,13 @@ func (Categorie) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (Categorie) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "categorie"},
}
}
// Edges de l'entite Categorie.
func (Categorie) Edges() []ent.Edge {
return []ent.Edge{

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -47,12 +49,20 @@ func (ChampPersonnalise) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (ChampPersonnalise) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "champ_personnalise"},
}
}
// Edges de l'entite ChampPersonnalise.
func (ChampPersonnalise) Edges() []ent.Edge {
return []ent.Edge{
edge.From("objet", Objet.Type).
Ref("champs_personnalises").
Unique().
Field("objet_id"),
Field("objet_id").
Required(),
}
}

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -57,6 +59,13 @@ func (Emplacement) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (Emplacement) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "emplacement"},
}
}
// Edges de l'entite Emplacement.
func (Emplacement) Edges() []ent.Edge {
return []ent.Edge{
@@ -65,5 +74,7 @@ func (Emplacement) Edges() []ent.Edge {
Unique().
Field("parent_id").
Comment("Lien parent/enfants pour l'arbre des emplacements"),
edge.To("liens_objets", LienObjetEmplacement.Type).
Comment("Liens entre emplacements et objets"),
}
}

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -38,16 +40,25 @@ func (LienObjetEmplacement) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (LienObjetEmplacement) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "lien_objet_emplacement"},
}
}
// Edges de l'entite LienObjetEmplacement.
func (LienObjetEmplacement) Edges() []ent.Edge {
return []ent.Edge{
edge.From("objet", Objet.Type).
Ref("liens_emplacements").
Unique().
Field("objet_id"),
Field("objet_id").
Required(),
edge.From("emplacement", Emplacement.Type).
Ref("liens_objets").
Unique().
Field("emplacement_id"),
Field("emplacement_id").
Required(),
}
}

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -60,7 +62,6 @@ func (Objet) Fields() []ent.Field {
Comment("Statut de l'objet"),
field.JSON("caracteristiques", map[string]any{}).
Optional().
Nillable().
Comment("Caracteristiques personnalisees"),
field.Time("created_at").
Default(time.Now).
@@ -72,6 +73,13 @@ func (Objet) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (Objet) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "objet"},
}
}
// Edges de l'entite Objet.
func (Objet) Edges() []ent.Edge {
return []ent.Edge{

View File

@@ -4,6 +4,8 @@ import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
@@ -48,12 +50,20 @@ func (PieceJointe) Fields() []ent.Field {
}
}
// Annotations pour le nom de table.
func (PieceJointe) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "piece_jointe"},
}
}
// Edges de l'entite PieceJointe.
func (PieceJointe) Edges() []ent.Edge {
return []ent.Edge{
edge.From("objet", Objet.Type).
Ref("pieces_jointes").
Unique().
Field("objet_id"),
Field("objet_id").
Required(),
}
}