Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

Use this file to discover all available pages before exploring further.

The pharmacy module gives drugstores and medical supply shops a purpose-built inventory and point-of-sale system. Products are categorised by therapeutic class (e.g., analgesics, antibiotics), tracked by lot (batch_product) and expiration date, and sold to optionally identified clients — all within a single company tenant. Each document type gets its own sequential bill counter so products, sales, and batches are numbered independently.

Data Models

Product

Stored in collection product_pharmacy. Represents a medicine or medical supply item held in inventory.
FieldTypeNotes
bill_counterStringAuto-generated product reference number
name_productStringProduct name
category_productString (enum)One of: "analgesicos", "antibioticos", "gastrointestinal", "antialergicos", "diabetes", "cardiovascular", "vitaminas", "higiene", "material medico", "respiratorio"
cost_productStringPurchase / acquisition cost
price_productStringRetail sale price
unit_productString (enum)"unidad", "kg", "gramo", "litro", "metro", "caja", "paquete", "rollo", or ""
stock_productNumberMaximum stock quantity
minimum_stock_productNumberMinimum stock alert threshold
batch_productArrayArray of lot objects: { lote: String, expiration_date: Date, quantity: Number }
expiration_date_productStringOverall product expiration date
companyStringID of the owning company
Use minimum_stock_product to trigger restocking alerts in your front end. When stock_product falls at or below this value, consider flagging the product for reorder.

Client

Stored in collection client_pharmacy. Represents a pharmacy customer.
FieldTypeNotes
name_clientStringClient full name (defaults to "")
email_clientStringEmail address (defaults to "--------------")
phone_clientStringPhone number (defaults to "--------------")
nit_clientStringTax or document number (defaults to "Sin NIT")
type_clientString (enum)"Individual", "Empresa", or "--------------"
address_clientStringStreet address (defaults to "--------------")
company_idStringID of the owning company

Sale

Stored in collection sale_pharmacy. Records a product sold to a client.
FieldTypeNotes
bill_counterStringAuto-generated sale invoice number
companyStringID of the owning company
productObjectSnapshot of product fields (_id, bill_counter, name_product, category_product, unit_product, price_product, batch_product)
client._idStringClient ID snapshot
client.name_clientStringClient name snapshot
type_paymentString (enum)"Efectivo" (default), "Tarjeta", or "Transferencia"
quantityNumberQuantity purchased (defaults to 0)
priceStringUnit price at time of sale
sub_totalStringSubtotal before adjustments
totalStringFinal total amount

Bill Counters

The pharmacy module uses three separate counters, all stored in the company’s counters Map and auto-incremented by the API. These are initialised when a company of type_company: "farmacia" is registered via companyConfig.js:
Counter KeyUsed ForExample Value
bill_counter_pharmacyProduct reference numberingPROD-0001
bill_counter_sale_pharmacySale invoice numberingVTA-0001
bill_counter_batchBatch / lot numberingLOTE-0001
These counters are initialised to 0 when a company of type_company: "farmacia" is registered. They are independent of counters used by other modules (e.g., sublimation or restaurant).

API Endpoints Summary

Products — /api/product-pharmacy

MethodEndpointDescription
POST/api/product-pharmacy/:company_idCreate a new pharmacy product
PATCH/api/product-pharmacy/:company_id/updating/:product_idUpdate a pharmacy product
PUT/api/product-pharmacy/:company_id/company/:product_id/product/:batch_idUpdate a product batch/lot
GET/api/product-pharmacy/:company_idList all products for a company (paginated)
GET/api/product-pharmacy/stock/:company_idList products at or below minimum stock (paginated)
GET/api/product-pharmacy/lotes/:company_idList product lots / expiration data (paginated)
DELETE/api/product-pharmacy/remove/:company_id/-/:product_id/-/:batch_idDelete a specific product batch
DELETE/api/product-pharmacy/:company_id/-/:product_idDelete a product

Clients — /api/client-pharmacy

MethodEndpointDescription
POST/api/client-pharmacy/:company_idCreate a new client
PUT/api/client-pharmacy/:company_id/updating/:client_idUpdate a client
GET/api/client-pharmacy/:company_idList all clients for a company (paginated)
DELETE/api/client-pharmacy/:client_idDelete a client

Sales — /api/sale-pharmacy

MethodEndpointDescription
POST/api/sale-pharmacy/:company_id/sale/:product_idCreate a sale for a specific product
GET/api/sale-pharmacy/:company_idList all sales for a company (paginated)

Full Pharmacy API Reference

Browse the complete endpoint reference for products, clients, and sales in the pharmacy module.

Build docs developers (and LLMs) love