Skip to content

http ​

go
import "github.com/prescriptoo/prescriptoo-api/services/medicine/internal/presentation/http"

Package http exposes medicine catalog queries over HTTP.

Index ​

type Handler ​

Handler wires individual catalog operations.

go
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 ​

go
func NewHandler(repo ports.CatalogRepository) *Handler

NewHandler creates catalog routes.

func (*Handler) RegisterHuma ​

go
func (h *Handler) RegisterHuma(api huma.API)

RegisterHuma registers all medicine reader queries.

type MedicineBrandGetBodyDto ​

MedicineBrandGetBodyDto defines the HTTP response.

go
type MedicineBrandGetBodyDto struct {
    Message    string                  `json:"message"`
    StatusCode int                     `json:"status_code"`
    Data       MedicineBrandGetDataDto `json:"data"`
}

type MedicineBrandGetDataDto ​

MedicineBrandGetDataDto contains catalog response fields.

go
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.

go
type MedicineBrandGetReqDto struct {
    Authorization string `header:"Authorization" hidden:"true"`
    ID            string `path:"id" minLength:"1" pattern:"\\S"`
}

type MedicineBrandGetResDto ​

MedicineBrandGetResDto defines the HTTP response.

go
type MedicineBrandGetResDto struct{ Body MedicineBrandGetBodyDto }

type MedicineBrandListBodyDto ​

MedicineBrandListBodyDto defines the HTTP response.

go
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.

go
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.

go
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.

go
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.

go
type MedicineBrandListResDto struct{ Body MedicineBrandListBodyDto }

type MedicineDrugGetBodyDto ​

MedicineDrugGetBodyDto defines the HTTP response.

go
type MedicineDrugGetBodyDto struct {
    Message    string                 `json:"message"`
    StatusCode int                    `json:"status_code"`
    Data       MedicineDrugGetDataDto `json:"data"`
}

type MedicineDrugGetDataDto ​

MedicineDrugGetDataDto contains catalog response fields.

go
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.

go
type MedicineDrugGetReqDto struct {
    Authorization string `header:"Authorization" hidden:"true"`
    ID            string `path:"id" minLength:"1" pattern:"\\S"`
}

type MedicineDrugGetResDto ​

MedicineDrugGetResDto defines the HTTP response.

go
type MedicineDrugGetResDto struct{ Body MedicineDrugGetBodyDto }

type MedicineDrugGetSummaryDto ​

MedicineDrugGetSummaryDto contains related catalog display data.

go
type MedicineDrugGetSummaryDto struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

type MedicineDrugListBodyDto ​

MedicineDrugListBodyDto defines the HTTP response.

go
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.

go
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.

go
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.

go
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.

go
type MedicineDrugListResDto struct{ Body MedicineDrugListBodyDto }

type MedicineDrugListSummaryDto ​

MedicineDrugListSummaryDto contains related catalog display data.

go
type MedicineDrugListSummaryDto struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

type MedicineGenericGetBodyDto ​

MedicineGenericGetBodyDto defines the HTTP response.

go
type MedicineGenericGetBodyDto struct {
    Message    string                    `json:"message"`
    StatusCode int                       `json:"status_code"`
    Data       MedicineGenericGetDataDto `json:"data"`
}

type MedicineGenericGetDataDto ​

MedicineGenericGetDataDto contains catalog response fields.

go
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.

go
type MedicineGenericGetReqDto struct {
    Authorization string `header:"Authorization" hidden:"true"`
    ID            string `path:"id" minLength:"1" pattern:"\\S"`
}

type MedicineGenericGetResDto ​

MedicineGenericGetResDto defines the HTTP response.

go
type MedicineGenericGetResDto struct{ Body MedicineGenericGetBodyDto }

type MedicineGenericListBodyDto ​

MedicineGenericListBodyDto defines the HTTP response.

go
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.

go
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.

go
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.

go
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.

go
type MedicineGenericListResDto struct{ Body MedicineGenericListBodyDto }

type MedicineManufacturerGetBodyDto ​

MedicineManufacturerGetBodyDto defines the response envelope.

go
type MedicineManufacturerGetBodyDto struct {
    Message    string                         `json:"message"`
    StatusCode int                            `json:"status_code"`
    Data       MedicineManufacturerGetDataDto `json:"data"`
}

type MedicineManufacturerGetDataDto ​

MedicineManufacturerGetDataDto contains catalog response fields.

go
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.

go
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.

go
type MedicineManufacturerGetResDto struct {
    Body MedicineManufacturerGetBodyDto
}

type MedicineManufacturerListBodyDto ​

MedicineManufacturerListBodyDto defines the response envelope.

go
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.

go
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.

go
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.

go
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.

go
type MedicineManufacturerListResDto struct {
    Body MedicineManufacturerListBodyDto
}

type MedicineQuickSigDto ​

MedicineQuickSigDto describes a curated editable direction preset.

go
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

Documentation follows the source. Planned contracts are marked explicitly.