What the store sells, as a registry of value objects.
An item is registered, never compiled in: a deployment declares its own
catalog at boot and nothing below this namespace knows what a :pro is. The
sample catalog exists so a fresh checkout runs before anyone has configured
anything.
The registry is a VALUE the caller holds, created by store. Two stores
embedded in one JVM own two catalogs.
What the store sells, as a registry of value objects. An item is registered, never compiled in: a deployment declares its own catalog at boot and nothing below this namespace knows what a `:pro` is. The sample catalog exists so a fresh checkout runs before anyone has configured anything. The registry is a VALUE the caller holds, created by `store`. Two stores embedded in one JVM own two catalogs.
(clear! catalog)Forget every registered item. For tests and for a boot that owns the whole catalog.
Forget every registered item. For tests and for a boot that owns the whole catalog.
(item catalog item-id)Registered Item for item-id, or nil.
Registered Item for `item-id`, or nil.
(items catalog)Every registered item, in id order.
Every registered item, in id order.
(listed catalog)Items a customer may see. An unlisted item is still sellable — an operator can open one — it simply is not advertised.
Items a customer may see. An unlisted item is still sellable — an operator can open one — it simply is not advertised.
(listed? catalog item-id)True when item-id is registered and advertised.
True when `item-id` is registered and advertised.
(price item)The stored price of item, as Money.
The stored price of `item`, as Money.
(register! catalog item)Register item in catalog, replacing any item with the same id. Returns
the item.
Validated on the way in: an item priced in a currency nobody can settle, or with a negative amount, is a checkout that fails at the customer rather than at boot.
Register `item` in `catalog`, replacing any item with the same id. Returns the item. Validated on the way in: an item priced in a currency nobody can settle, or with a negative amount, is a checkout that fails at the customer rather than at boot.
(register-all! catalog items)Register every item in items. Returns them.
Register every item in `items`. Returns them.
A catalog to run against before a deployment declares its own.
A catalog to run against before a deployment declares its own.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |