Skip to content

Commit

Permalink
feat: add new entities
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmesquitta committed May 31, 2024
1 parent 4c01d4f commit 62a5fc0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
10 changes: 9 additions & 1 deletion internal/domain/entity/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ func (e *AppError) Error() string {
}

var (
ErrUserNotFound *AppError = &AppError{
HTTPStatusCode: 404,
Message: "user not found",
}
ErrValidation *AppError = &AppError{
HTTPStatusCode: 400,
Message: "Validation error",
Message: "validation error",
}
ErrTokenExpired *AppError = &AppError{
HTTPStatusCode: 401,
Message: "token expired",
}
)
14 changes: 14 additions & 0 deletions internal/domain/entity/setting.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package entity

import "time"

type Setting struct {
ID string `json:"id"`
NotionToken string `json:"notion_token"`
NotionPageID string `json:"notion_page_id"`
MeuPluggyClientID string `json:"meu_pluggy_client_id"`
MeuPluggyClientSecret string `json:"meu_pluggy_client_secret"`
MeuPluggyAccountIDs []string `json:"meu_pluggy_account_ids"`
UserID string `json:"user_id"`
UpdatedAt time.Time `json:"updated_at"`
}
12 changes: 6 additions & 6 deletions internal/domain/entity/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package entity
import "time"

type Transaction struct {
Name string
Description string
Category string
Amount float64
PaymentMethod PaymentMethod
Date time.Time
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Amount float64 `json:"amount"`
PaymentMethod PaymentMethod `json:"payment_method"`
Date time.Time `json:"date"`
}
12 changes: 12 additions & 0 deletions internal/domain/entity/user.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package entity

import (
"time"
)

type User struct {
ID string `json:"id"`
Email string `json:"email"`
UpdatedAt time.Time `json:"updated_at"`
Setting *Setting `json:"setting"`
}

0 comments on commit 62a5fc0

Please sign in to comment.