Skip to content

public ​

go
import "github.com/prescriptoo/prescriptoo-api/services/doctor/public"

Package public exposes doctor-owned API data without domain or repository types.

Index ​

Variables ​

Catalog validation, lookup, and relationship errors.

go
var (
    // ErrInvalidCatalogInput indicates malformed professional reference data.
    ErrInvalidCatalogInput = errors.New("invalid professional catalog input")
    // ErrCatalogNotFound indicates a missing term.
    ErrCatalogNotFound = errors.New("professional catalog entry not found")
    // ErrCatalogConflict indicates a duplicate or referenced term.
    ErrCatalogConflict = errors.New("professional catalog entry already exists or is in use")
)

go
var (
    // ErrProfileNotFound indicates that no professional profile matches the identifier.
    ErrProfileNotFound = errors.New("doctor profile not found")
    // ErrUnavailable indicates that the doctor directory is unavailable.
    ErrUnavailable = errors.New("doctor directory unavailable")
)

func SpecializationSummary ​

go
func SpecializationSummary(entries []CatalogEntry) string

SpecializationSummary renders selected names for immutable legacy snapshots.

type BatchDirectory ​

BatchDirectory reads a selected set of professional profiles in one operation.

go
type BatchDirectory interface {
    // GetProfiles returns the professional records that exist within a selected
    // ID batch. Names/account states remain owned by Identity and are enriched separately.
    GetProfiles(context.Context, []string) ([]Profile, error)
}

type CatalogEntry ​

CatalogEntry is reference data, not evidence that a doctor holds a credential. SpecialityID is populated only for specializations.

go
type CatalogEntry struct {
    ID           string    `json:"id" format:"uuid"`
    Name         string    `json:"name"`
    Description  string    `json:"description"`
    SpecialityID string    `json:"speciality_id,omitempty" format:"uuid"`
    CreatedAt    time.Time `json:"created_at"`
    UpdatedAt    time.Time `json:"updated_at"`
}

type CatalogKind ​

CatalogKind identifies a doctor-owned professional reference table.

go
type CatalogKind string

Supported professional reference catalogs.

go
const (
    Qualifications  CatalogKind = "qualifications"
    Specialties     CatalogKind = "specialties"
    Specializations CatalogKind = "specializations"
)

type CatalogListOptions ​

CatalogListOptions filters children by their owning speciality.

go
type CatalogListOptions struct{ SpecialityID string }

type CatalogManager ​

CatalogManager is consumed only after platform-admin authorization.

go
type CatalogManager interface {
    CatalogReader
    Create(context.Context, CatalogKind, CatalogValues) (*CatalogEntry, error)
    Update(context.Context, CatalogKind, string, CatalogValues) (*CatalogEntry, error)
    Delete(context.Context, CatalogKind, string) error
}

type CatalogReader ​

CatalogReader supplies reusable professional reference data.

go
type CatalogReader interface {
    List(context.Context, CatalogKind, CatalogListOptions) ([]CatalogEntry, error)
    Get(context.Context, CatalogKind, string) (*CatalogEntry, error)
}

type CatalogValues ​

CatalogValues replaces the editable fields of a catalog entry.

go
type CatalogValues struct {
    Name         string `json:"name" minLength:"1" maxLength:"255"`
    Description  string `json:"description,omitempty" maxLength:"2000"`
    SpecialityID string `json:"speciality_id,omitempty" format:"uuid" doc:"Required for a specialization; forbidden for qualifications and specialties."`
}

type Chamber ​

Chamber describes a doctor's practice location and visiting hours.

go
type Chamber struct {
    Name    string `json:"name" minLength:"1" maxLength:"255"`
    Address string `json:"address" minLength:"1" maxLength:"2000"`
    Hours   string `json:"hours" minLength:"1" maxLength:"1000" doc:"Visiting hours as display text."`
}

type Directory ​

Directory exposes professional records without credentials or persistence details. Name, email and account status must be read through Identity.

go
type Directory interface {
    GetProfile(context.Context, string) (*Profile, error)
    GetProfileByUserID(context.Context, string) (*Profile, error)
    ListProfiles(context.Context) ([]Profile, error)
}

type Profile ​

Profile is owned by doctor; credentials and account status remain in identity.

go
type Profile struct {
    Qualifications []CatalogEntry `json:"qualifications" nullable:"false" doc:"Selected qualification catalog entries; not proof of credential verification."`
    ID             string         `json:"id"`
    UserID         string         `json:"user_id"`
    Name           string         `json:"name"`
    Email          string         `json:"email" format:"email"`
    LicenseNumber  string         `json:"license_number"`
    Speciality     CatalogEntry   `json:"speciality"`
    Specialization []CatalogEntry `json:"specialization" nullable:"false" maxItems:"30"`
    Qualification  string         `json:"qualification,omitempty" maxLength:"7708" doc:"Qualification display summary; derived from catalog selections when configured."`
    Chambers       []Chamber      `json:"chambers,omitempty" nullable:"false" maxItems:"20"`
    CreatedAt      time.Time      `json:"created_at"`
    UpdatedAt      time.Time      `json:"updated_at"`
}

type SpecializationValues ​

SpecializationValues requires a parent for specialization creation/replacement.

go
type SpecializationValues struct {
    Name         string `json:"name" minLength:"1" maxLength:"255"`
    Description  string `json:"description,omitempty" maxLength:"2000"`
    SpecialityID string `json:"speciality_id" format:"uuid"`
}

func (SpecializationValues) CatalogValues ​

go
func (v SpecializationValues) CatalogValues() CatalogValues

CatalogValues converts a specialization command to the shared provider contract.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.