http
import "github.com/prescriptoo/prescriptoo-api/services/medicine/internal/presentation/http"Package http exposes medicine catalog queries over HTTP.
Index
- type Handler
- type MedicineBrandGetBodyDto
- type MedicineBrandGetDataDto
- type MedicineBrandGetReqDto
- type MedicineBrandGetResDto
- type MedicineBrandListBodyDto
- type MedicineBrandListItemDto
- type MedicineBrandListPaginationDto
- type MedicineBrandListReqDto
- type MedicineBrandListResDto
- type MedicineDrugGetBodyDto
- type MedicineDrugGetDataDto
- type MedicineDrugGetReqDto
- type MedicineDrugGetResDto
- type MedicineDrugGetSummaryDto
- type MedicineDrugListBodyDto
- type MedicineDrugListItemDto
- type MedicineDrugListPaginationDto
- type MedicineDrugListReqDto
- type MedicineDrugListResDto
- type MedicineDrugListSummaryDto
- type MedicineGenericGetBodyDto
- type MedicineGenericGetDataDto
- type MedicineGenericGetReqDto
- type MedicineGenericGetResDto
- type MedicineGenericListBodyDto
- type MedicineGenericListItemDto
- type MedicineGenericListPaginationDto
- type MedicineGenericListReqDto
- type MedicineGenericListResDto
- type MedicineManufacturerGetBodyDto
- type MedicineManufacturerGetDataDto
- type MedicineManufacturerGetReqDto
- type MedicineManufacturerGetResDto
- type MedicineManufacturerListBodyDto
- type MedicineManufacturerListItemDto
- type MedicineManufacturerListPaginationDto
- type MedicineManufacturerListReqDto
- type MedicineManufacturerListResDto
- type MedicineQuickSigDto
type Handler
Handler wires individual catalog operations.
type Handler struct {
ListManufacturers *usecase.ListManufacturersUseCase
GetManufacturer *usecase.GetManufacturerUseCase
ListGenerics *usecase.ListGenericsUseCase
GetGeneric *usecase.GetGenericUseCase
ListBrands *usecase.ListBrandsUseCase
GetBrand *usecase.GetBrandUseCase
ListDrugs *usecase.ListDrugsUseCase
GetDrug *usecase.GetDrugUseCase
}func NewHandler
func NewHandler(repo ports.CatalogRepository) *HandlerNewHandler creates catalog routes.
func (*Handler) RegisterHuma
func (h *Handler) RegisterHuma(api huma.API)RegisterHuma registers all medicine reader queries.
type MedicineBrandGetBodyDto
MedicineBrandGetBodyDto defines the HTTP response.
type MedicineBrandGetBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data MedicineBrandGetDataDto `json:"data"`
}type MedicineBrandGetDataDto
MedicineBrandGetDataDto contains catalog response fields.
type MedicineBrandGetDataDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
ManufacturerID string `json:"manufacturer_id"`
GenericID string `json:"generic_id"`
}type MedicineBrandGetReqDto
MedicineBrandGetReqDto defines the HTTP request.
type MedicineBrandGetReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
ID string `path:"id" minLength:"1" pattern:"\\S"`
}type MedicineBrandGetResDto
MedicineBrandGetResDto defines the HTTP response.
type MedicineBrandGetResDto struct{ Body MedicineBrandGetBodyDto }type MedicineBrandListBodyDto
MedicineBrandListBodyDto defines the HTTP response.
type MedicineBrandListBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data []MedicineBrandListItemDto `json:"data" nullable:"false"`
Pagination MedicineBrandListPaginationDto `json:"pagination"`
}type MedicineBrandListItemDto
MedicineBrandListItemDto contains catalog response fields.
type MedicineBrandListItemDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
ManufacturerID string `json:"manufacturer_id"`
GenericID string `json:"generic_id"`
}type MedicineBrandListPaginationDto
MedicineBrandListPaginationDto describes cursor pagination.
type MedicineBrandListPaginationDto struct {
NextCursor string `json:"next_cursor"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}type MedicineBrandListReqDto
MedicineBrandListReqDto defines the HTTP request.
type MedicineBrandListReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
Q string `query:"q" maxLength:"255"`
Limit int `query:"limit" minimum:"1" maximum:"100" default:"20"`
Cursor string `query:"cursor"`
ManufacturerID string `query:"manufacturer_id" minLength:"1" maxLength:"255" pattern:"\\S"`
GenericID string `query:"generic_id" minLength:"1" maxLength:"255" pattern:"\\S"`
}type MedicineBrandListResDto
MedicineBrandListResDto defines the HTTP response.
type MedicineBrandListResDto struct{ Body MedicineBrandListBodyDto }type MedicineDrugGetBodyDto
MedicineDrugGetBodyDto defines the HTTP response.
type MedicineDrugGetBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data MedicineDrugGetDataDto `json:"data"`
}type MedicineDrugGetDataDto
MedicineDrugGetDataDto contains catalog response fields.
type MedicineDrugGetDataDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
BrandID string `json:"brand_id"`
Form string `json:"form"`
Strength string `json:"strength"`
Route string `json:"route"`
TherapeuticClassID string `json:"therapeutic_class_id"`
CatalogueVersion string `json:"catalogue_version"`
Aliases []string `json:"aliases" nullable:"false"`
IngredientIDs []string `json:"ingredient_ids" nullable:"false"`
QuickSigs []MedicineQuickSigDto `json:"quick_sigs" nullable:"false"`
Brand MedicineDrugGetSummaryDto `json:"brand"`
Generic MedicineDrugGetSummaryDto `json:"generic"`
Manufacturer MedicineDrugGetSummaryDto `json:"manufacturer"`
}type MedicineDrugGetReqDto
MedicineDrugGetReqDto defines the HTTP request.
type MedicineDrugGetReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
ID string `path:"id" minLength:"1" pattern:"\\S"`
}type MedicineDrugGetResDto
MedicineDrugGetResDto defines the HTTP response.
type MedicineDrugGetResDto struct{ Body MedicineDrugGetBodyDto }type MedicineDrugGetSummaryDto
MedicineDrugGetSummaryDto contains related catalog display data.
type MedicineDrugGetSummaryDto struct {
ID string `json:"id"`
Name string `json:"name"`
}type MedicineDrugListBodyDto
MedicineDrugListBodyDto defines the HTTP response.
type MedicineDrugListBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data []MedicineDrugListItemDto `json:"data" nullable:"false"`
Pagination MedicineDrugListPaginationDto `json:"pagination"`
}type MedicineDrugListItemDto
MedicineDrugListItemDto contains catalog response fields.
type MedicineDrugListItemDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
BrandID string `json:"brand_id"`
Form string `json:"form"`
Strength string `json:"strength"`
Route string `json:"route"`
TherapeuticClassID string `json:"therapeutic_class_id"`
CatalogueVersion string `json:"catalogue_version"`
Aliases []string `json:"aliases" nullable:"false"`
IngredientIDs []string `json:"ingredient_ids" nullable:"false"`
QuickSigs []MedicineQuickSigDto `json:"quick_sigs" nullable:"false"`
Brand MedicineDrugListSummaryDto `json:"brand"`
Generic MedicineDrugListSummaryDto `json:"generic"`
Manufacturer MedicineDrugListSummaryDto `json:"manufacturer"`
}type MedicineDrugListPaginationDto
MedicineDrugListPaginationDto describes cursor pagination.
type MedicineDrugListPaginationDto struct {
NextCursor string `json:"next_cursor"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}type MedicineDrugListReqDto
MedicineDrugListReqDto defines the HTTP request.
type MedicineDrugListReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
Q string `query:"q" maxLength:"255"`
Limit int `query:"limit" minimum:"1" maximum:"100" default:"20"`
Cursor string `query:"cursor"`
ManufacturerID string `query:"manufacturer_id" minLength:"1" maxLength:"255" pattern:"\\S"`
GenericID string `query:"generic_id" minLength:"1" maxLength:"255" pattern:"\\S"`
BrandID string `query:"brand_id" minLength:"1" maxLength:"255" pattern:"\\S"`
Form string `query:"form" minLength:"1" maxLength:"255" pattern:"\\S"`
}type MedicineDrugListResDto
MedicineDrugListResDto defines the HTTP response.
type MedicineDrugListResDto struct{ Body MedicineDrugListBodyDto }type MedicineDrugListSummaryDto
MedicineDrugListSummaryDto contains related catalog display data.
type MedicineDrugListSummaryDto struct {
ID string `json:"id"`
Name string `json:"name"`
}type MedicineGenericGetBodyDto
MedicineGenericGetBodyDto defines the HTTP response.
type MedicineGenericGetBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data MedicineGenericGetDataDto `json:"data"`
}type MedicineGenericGetDataDto
MedicineGenericGetDataDto contains catalog response fields.
type MedicineGenericGetDataDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
}type MedicineGenericGetReqDto
MedicineGenericGetReqDto defines the HTTP request.
type MedicineGenericGetReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
ID string `path:"id" minLength:"1" pattern:"\\S"`
}type MedicineGenericGetResDto
MedicineGenericGetResDto defines the HTTP response.
type MedicineGenericGetResDto struct{ Body MedicineGenericGetBodyDto }type MedicineGenericListBodyDto
MedicineGenericListBodyDto defines the HTTP response.
type MedicineGenericListBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data []MedicineGenericListItemDto `json:"data" nullable:"false"`
Pagination MedicineGenericListPaginationDto `json:"pagination"`
}type MedicineGenericListItemDto
MedicineGenericListItemDto contains catalog response fields.
type MedicineGenericListItemDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
}type MedicineGenericListPaginationDto
MedicineGenericListPaginationDto describes cursor pagination.
type MedicineGenericListPaginationDto struct {
NextCursor string `json:"next_cursor"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}type MedicineGenericListReqDto
MedicineGenericListReqDto defines the HTTP request.
type MedicineGenericListReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
Q string `query:"q" maxLength:"255"`
Limit int `query:"limit" minimum:"1" maximum:"100" default:"20"`
Cursor string `query:"cursor"`
}type MedicineGenericListResDto
MedicineGenericListResDto defines the HTTP response.
type MedicineGenericListResDto struct{ Body MedicineGenericListBodyDto }type MedicineManufacturerGetBodyDto
MedicineManufacturerGetBodyDto defines the response envelope.
type MedicineManufacturerGetBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data MedicineManufacturerGetDataDto `json:"data"`
}type MedicineManufacturerGetDataDto
MedicineManufacturerGetDataDto contains catalog response fields.
type MedicineManufacturerGetDataDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
}type MedicineManufacturerGetReqDto
MedicineManufacturerGetReqDto defines the HTTP request.
type MedicineManufacturerGetReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
ID string `path:"id" minLength:"1" pattern:"\\S"`
}type MedicineManufacturerGetResDto
MedicineManufacturerGetResDto wraps the HTTP response body.
type MedicineManufacturerGetResDto struct {
Body MedicineManufacturerGetBodyDto
}type MedicineManufacturerListBodyDto
MedicineManufacturerListBodyDto defines the response envelope.
type MedicineManufacturerListBodyDto struct {
Message string `json:"message"`
StatusCode int `json:"status_code"`
Data []MedicineManufacturerListItemDto `json:"data" nullable:"false"`
Pagination MedicineManufacturerListPaginationDto `json:"pagination"`
}type MedicineManufacturerListItemDto
MedicineManufacturerListItemDto contains catalog response fields.
type MedicineManufacturerListItemDto struct {
ID string `json:"id"`
Status string `json:"status" enum:"active,inactive"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
}type MedicineManufacturerListPaginationDto
MedicineManufacturerListPaginationDto describes cursor pagination.
type MedicineManufacturerListPaginationDto struct {
NextCursor string `json:"next_cursor"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}type MedicineManufacturerListReqDto
MedicineManufacturerListReqDto defines the HTTP request.
type MedicineManufacturerListReqDto struct {
Authorization string `header:"Authorization" hidden:"true"`
Q string `query:"q" maxLength:"255"`
Limit int `query:"limit" minimum:"1" maximum:"100" default:"20"`
Cursor string `query:"cursor"`
}type MedicineManufacturerListResDto
MedicineManufacturerListResDto wraps the HTTP response body.
type MedicineManufacturerListResDto struct {
Body MedicineManufacturerListBodyDto
}type MedicineQuickSigDto
MedicineQuickSigDto describes a curated editable direction preset.
type MedicineQuickSigDto struct {
ID string `json:"id"`
Label string `json:"label"`
Dose string `json:"dose"`
Frequency string `json:"frequency"`
Timing string `json:"timing"`
MealRelation string `json:"meal_relation"`
Duration string `json:"duration"`
}Generated by gomarkdoc