Files
wekan/models/lib
Lauri Ojansivu 0aa3d0b9d6 Shop: products, cart, totals and orders computed from the cards.
models/lib/shop.js is the one place the Shop's rules live, loaded by the
browser, the server and the tests alike:

- a product is a card, not archived, in a list on sale, whose price custom
  field (Number, Currency or Text) holds a number; its title, description,
  cover, labels (the categories) and optional product code and stock fields;
- money is an integer of the currency's minor unit, as in Budget and billing;
- a cart is card ids and quantities only: any price or total sent with it is
  dropped and reported, and the order is priced from the cards, with the VAT
  taken out of prices that include it or added as an invoice adds it;
- the payment methods are Budget and billing's (normalizePaymentMethod,
  paymentInstructions), and the payment reference its paymentReference;
- the checkout gate, the buyer's details (a name and an email, optionally a
  phone, an address and a message), and the order card's Markdown with every
  text the buyer typed escaped;
- a public board opens in one view, so showing the Shop there replaces the
  Website or any other public default, and the other way round.

Board Settings / Shop is stored on the board as shopSettings (a blackbox
field, written only by the server method that checks it), and a WeKan
export does not carry it to another WeKan. models/shopOrders.js numbers the
orders and keeps no personal data.

Thanks to xet7 !
2026-11-22 19:41:40 +02:00
..
2026-06-06 07:21:59 +03:00
2026-11-20 09:16:10 +02:00
2026-10-14 14:04:07 +03:00