model

package
v0.0.0-...-6d561a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package model contains the shared Petclinic domain building blocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEntity

type BaseEntity struct {
	ID ID `json:"id"`
}

BaseEntity gives persistent Petclinic entities a stable identity. A zero ID identifies an entity that has not been persisted.

func (BaseEntity) New

func (entity BaseEntity) New() bool

New reports whether the entity has not yet been persisted.

type ID

type ID int64

ID is a persistent Petclinic entity identity.

func (ID) Valid

func (id ID) Valid() bool

Valid reports whether the identity denotes a persisted entity.

type NamedEntity

type NamedEntity struct {
	BaseEntity
	Name string `json:"name"`
}

NamedEntity is the shared shape for reference data such as pet types and veterinary specialties.

type Person

type Person struct {
	BaseEntity
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

Person is the shared name data for owners and veterinarians.

func (Person) Validate

func (person Person) Validate() (validation.Errors, error)

Validate returns stable, presentation-safe person violations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL