---
# System prepended metadata

title: Resources

---

# Resources
* users
* books
* leases

# Data model

User {
    id int64
    name string
}

Media {
    id int64
    title string
    author string
    availableNumber int
    yearPublished int
    mediaType MediaType
}

MediaType {
    id int
    name string
    maxLeaseTime time.Duration
}

Medias {
    []Media
}

searchFilters []searchFilter

searchFilter {
    dimension string // title/author/yearPublished/media_type_name
    value string
}

Lease {
    id int64
    user User
    media Media
    duration time.Duration
    expiryTime time.Time
}

# Endpoints
/login
-> authToken
/logout

/search
authToken
searchFilters
LIKE "%value%"


/borrow
{}

/renew

/return

# Authentication
/
