first commit
This commit is contained in:
9
back/internal/domain/entities/coffee.go
Normal file
9
back/internal/domain/entities/coffee.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package entities
|
||||
|
||||
type Coffee struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Size string `json:"size"`
|
||||
}
|
||||
14
back/internal/domain/entities/order.go
Normal file
14
back/internal/domain/entities/order.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package entities
|
||||
|
||||
type Order struct {
|
||||
ID int `json:"id"`
|
||||
Items []Item `json:"items"`
|
||||
Total float64 `json:"total"`
|
||||
Status string `json:"status"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
ProductID int `json:"product_id"`
|
||||
Quantity int `json:"quantity"`
|
||||
}
|
||||
9
back/internal/domain/entities/pastry.go
Normal file
9
back/internal/domain/entities/pastry.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package entities
|
||||
|
||||
type Pastry struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Category string `json:"category"`
|
||||
}
|
||||
8
back/internal/domain/repositories/coffee_repository.go
Normal file
8
back/internal/domain/repositories/coffee_repository.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package repositories
|
||||
|
||||
import "awesome-back/internal/domain/entities"
|
||||
|
||||
type CoffeeRepository interface {
|
||||
FindAll() ([]entities.Coffee, error)
|
||||
FindByID(id int) (*entities.Coffee, error)
|
||||
}
|
||||
9
back/internal/domain/repositories/order_repository.go
Normal file
9
back/internal/domain/repositories/order_repository.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package repositories
|
||||
|
||||
import "awesome-back/internal/domain/entities"
|
||||
|
||||
type OrderRepository interface {
|
||||
FindAll() ([]entities.Order, error)
|
||||
FindByID(id int) (*entities.Order, error)
|
||||
Save(order *entities.Order) error
|
||||
}
|
||||
9
back/internal/domain/repositories/pastry_repository.go
Normal file
9
back/internal/domain/repositories/pastry_repository.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package repositories
|
||||
|
||||
import "awesome-back/internal/domain/entities"
|
||||
|
||||
type PastryRepository interface {
|
||||
FindAll() ([]entities.Pastry, error)
|
||||
FindByID(id int) (*entities.Pastry, error)
|
||||
FindByCategory(category string) ([]entities.Pastry, error)
|
||||
}
|
||||
Reference in New Issue
Block a user