Package-level declarations

Types

Link copied to clipboard
@Entity(name = "units")
data class AUnit(var id: Long?, var name: String, var type: UnitType, var inBase: Double, var intl: Boolean, var abbrev: String? = null, var altAbbrev: String? = null) : UnitBase

Class that can be either a weight or a volume. (Called AUnit because Unit is something else entirely in Kotlin.)

Link copied to clipboard
@Entity(name = "categories")
data class Category(var name: String, var id: Long? = null)

Record in the categories table.

Link copied to clipboard
@Entity
data class CategoryCount(val category: String, val count: Int)

A record returned by CountDao.getCategoryCounts

Link copied to clipboard
interface CategoryDao : JpaRepository<Category, Long>

Interface to the categories table in the database.

Link copied to clipboard
interface CountDao : JpaRepository<CategoryCount, String>

Interface to a stored procedure to get the number of Recipes in each Category.

Link copied to clipboard
@Serializable
data class Errors(val errors: List<String>)

A class that accumulates error messages, so that they can all be displayed at once.

Link copied to clipboard
@Entity(name = "foods")
data class FoodItem(var name: String, var description: String? = null, var notes: String? = null, var id: Long? = null)

Class describing any item that may be an ingredient for a recipe. Corresponds to the "foods" table.

Link copied to clipboard
interface FoodItemDao : JpaRepository<FoodItem, Long>

Interface to the database "foods" table

Link copied to clipboard
@Entity(name = "ingredients")
data class Ingredient(var itemId: Long, var amount: Double, var unit: String?, var recipeId: Long, var id: Long? = null)

An ingredient in a recipe. Corresponds to the ingredients table.

Link copied to clipboard
interface IngredientDao : JpaRepository<Ingredient, Long>

Interface to the "ingredients" table.

Link copied to clipboard
data class IngredientToSave(val name: String, val amount: Double, val unit: String, val type: String, val index: Int)

An Ingredient that is about to be saved with a Recipe. Note: Because of an implementation detail, recipe sort indices will actually start with 2, and end at the number of ingredients plus 1.

Link copied to clipboard
data class LocaleStrings(val strings: MutableMap<String, String>, val arrays: MutableMap<String, List<String>> = mutableMapOf())

Class that holds translated strings, for reference from base strings.

Link copied to clipboard
@Entity(name = "preferences")
data class Preference(var host: String, var key: String, var value: String, var id: Long? = null)

A single entry of a preference for this host. Note: there is no login, so only the host is important.

Link copied to clipboard
interface PreferenceDao : JpaRepository<Preference, Long>

Interface to the preferences database table.

Link copied to clipboard
@Entity(name = "recipes")
data class Recipe(var name: String, var directions: String, var servings: Int, var categoryId: Long, var id: Long? = null, var deleted: Boolean = false, var deletedOn: Instant? = null)

A recipe; a record in the "recipes" table.

Link copied to clipboard
interface RecipeDao : JpaRepository<Recipe, Long>

Interface to the recipes table in the database.

Link copied to clipboard
data class RecipeToSave(val id: Long?, val name: String, val category: String, val servings: Int, val directions: String, val ingredients: List<IngredientToSave>)

A recipe that is about to be saved.

Link copied to clipboard
abstract class UnitBase(var name: String = "", var inBase: Double = 0.0, var intl: Boolean = false, var abbrev: String? = null, var id: Long? = null, var altAbbrev: String? = null)

Abstract base class for units (Weight and Volume, and also the catchall AUnit. All constructor args have default values, so that we get a free no-arg constructor.

Link copied to clipboard
interface UnitDao : JpaRepository<AUnit, Long>

Interface to the "units" view (combination of "volumes" and "weights").

Link copied to clipboard
@Entity(name = "volumes")
data class Volume(var name: String, var inBase: Double, var intl: Boolean, var abbrev: String? = null, var id: Long? = null, var altAbbrev: String? = null) : UnitBase

Class that represents a volume measurement.

Link copied to clipboard
interface VolumeDao : JpaRepository<Volume, Long>

Interface to the volumes table in the database.

Link copied to clipboard
@Entity(name = "weights")
data class Weight(var name: String, var inBase: Double, var intl: Boolean, var abbrev: String? = null, var id: Long? = null, var altAbbrev: String? = null) : UnitBase

Class that represents a weight measurement.

Link copied to clipboard
interface WeightDao : JpaRepository<Weight, Long>

Interface to the weights database table.