Documentation ¶
Index ¶
- type APIService
- func (svc *APIService) CreateReport(ctx context.Context, request CreateReportRequest) (Report, error)
- func (svc *APIService) GetCustomerOrderHistory(ctx context.Context, request GetCustomerOrdersHistoryRequest) (history GetCustomerOrderHistoryResponse, err error)
- func (svc *APIService) GetDishesByIngredients(ctx context.Context, ingredient string) (dishes []dish.RecieveDish, err error)
- func (svc *APIService) GetDishesWithIngredients(ctx context.Context) (dishes []dish.Dish, err error)
- func (svc *APIService) GetEmployeesOrdersCount(ctx context.Context, request GetEmployeesOrdersCountRequest) (employees []GetEmployeesOrdersCountResponse, err error)
- func (svc *APIService) GetExpiringProducts(ctx context.Context) (products []GetExpiringSoonProductsResponse, err error)
- func (svc *APIService) GetMostPopularDishes(ctx context.Context) (dishes []GetMostPopularDishesResponse, err error)
- func (svc *APIService) GetSuppliersByProduct(ctx context.Context, productName string) (suppliers []supplier.Supplier, err error)
- func (svc *APIService) GetUnorderedDishes(ctx context.Context) (dishes []dish.RecieveDish, err error)
- type CreateReportRequest
- type Dish
- type GetCustomerOrderHistoryResponse
- type GetCustomerOrdersHistoryRequest
- type GetEmployeesOrdersCountRequest
- type GetEmployeesOrdersCountResponse
- type GetExpiringSoonProductsResponse
- type GetMostPopularDishesResponse
- type Order
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
func New ¶
func New(repo restaurantRepository) *APIService
func (*APIService) CreateReport ¶
func (svc *APIService) CreateReport(ctx context.Context, request CreateReportRequest) (Report, error)
func (*APIService) GetCustomerOrderHistory ¶
func (svc *APIService) GetCustomerOrderHistory(ctx context.Context, request GetCustomerOrdersHistoryRequest) (history GetCustomerOrderHistoryResponse, err error)
func (*APIService) GetDishesByIngredients ¶
func (svc *APIService) GetDishesByIngredients(ctx context.Context, ingredient string) (dishes []dish.RecieveDish, err error)
func (*APIService) GetDishesWithIngredients ¶
func (*APIService) GetEmployeesOrdersCount ¶
func (svc *APIService) GetEmployeesOrdersCount(ctx context.Context, request GetEmployeesOrdersCountRequest) (employees []GetEmployeesOrdersCountResponse, err error)
func (*APIService) GetExpiringProducts ¶
func (svc *APIService) GetExpiringProducts(ctx context.Context) (products []GetExpiringSoonProductsResponse, err error)
func (*APIService) GetMostPopularDishes ¶
func (svc *APIService) GetMostPopularDishes(ctx context.Context) (dishes []GetMostPopularDishesResponse, err error)
func (*APIService) GetSuppliersByProduct ¶
func (*APIService) GetUnorderedDishes ¶
func (svc *APIService) GetUnorderedDishes(ctx context.Context) (dishes []dish.RecieveDish, err error)
type GetCustomerOrderHistoryResponse ¶
type GetCustomerOrderHistoryResponse struct { CustomerID int64 `json:"customer_id" db:"customer_id"` FirstName string `json:"first_name" db:"first_name"` LastName string `json:"last_name" db:"last_name"` PhoneNumber string `json:"phone_number" db:"phone_number"` Email string `json:"email" db:"email"` Discount int `json:"discount" db:"discount"` OrdersBytes []byte `db:"orders"` Orders []Order `json:"orders"` }
type GetEmployeesOrdersCountResponse ¶
type GetEmployeesOrdersCountResponse struct { EmployeeID int64 `json:"employee_id" db:"employee_id"` PositionID int `json:"position_id" db:"position_id"` FirstName string `json:"first_name" db:"first_name"` LastName string `json:"last_name" db:"last_name"` PositionName string `json:"position_name" db:"position_name"` Salary float64 `json:"salary" db:"salary"` PhoneNumber string `json:"phone_number" db:"phone_number"` OrdersCount int `json:"orders_count" db:"orders_count"` }
type GetExpiringSoonProductsResponse ¶
type GetExpiringSoonProductsResponse struct { ProductID int64 `db:"product_id" json:"product_id"` Name string `db:"name" json:"name"` DateOfProduction string `db:"date_of_production" json:"date_of_production"` DateOfExpiry string `db:"date_of_expiry" json:"date_of_expiry"` Status string `db:"status" json:"status"` }
type Report ¶
type Report struct { LostRevenue float64 `json:"lost_revenue"` NetProfit float64 `json:"net_profit"` AverageSupplyCheck float64 `json:"average_supply_check"` AverageOrderCheck float64 `json:"average_order_check"` AmountSupplyCosts float64 `json:"amount_supply_costs"` DateFrom time.Time `json:"date_from"` DateTo time.Time `json:"date_to"` }
Click to show internal directories.
Click to hide internal directories.