Skip to content

Commit

Permalink
feat(database): add created_at to log model.
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Jan 30, 2025
1 parent 6b27ceb commit 313941d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (db *Database) AddLog(orderID, actor, desc, trace string) error {
Actor: actor,
Description: desc,
Trace: trace,
CreatedAt: time.Now().Unix(),
}

_, err := coll.InsertOne(ctx, log)
Expand Down
10 changes: 4 additions & 6 deletions database/models.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package database

type Log struct {
Actor string `bson:"actor"`

Actor string `bson:"actor"`
Description string `bson:"description"`

Trace string `bson:"trace"`

OrderID string `bson:"order_id"`
Trace string `bson:"trace"`
OrderID string `bson:"order_id"`
CreatedAt int64 `bson:"created_at"`
}

type State struct {
Expand Down

0 comments on commit 313941d

Please sign in to comment.