Add Budget Line
addBudgetLine creates a budgetLine โ an annual budget allocation that purchase orders draw against. It's the starting point of the Finance chapter: before a purchase order can reserve funds, its budget line has to exist. You need it whenever you allocate money (a code, title, year, and totalAllocated) for a department or the whole organization to spend.
Get Budget Lines
getBudgetLines lists the budgetLine collection, newest year first, with optional filters by organization and year. It's the read-side counterpart to addBudgetLine โ use it for any screen that shows the budget book: dashboards, finance reports, or the dropdown a purchase order picks its budget line from.
Get Budget Line Breakdown
getBudgetLineBreakdown is the analytics act of the Finance chapter: given one budgetLine, it returns the line's own fields, every purchaseOrder that draws against it, and a computed block that reconciles the money (encumbered, spent, available). Use it when you need to show why a budget line looks the way it does โ which orders reserved funds and which spent them.
Add Tender
addTender opens a tender โ a public procurement auction that collects supplier offers for a purchase. It's the act that starts competitive bidding: you give it a title (and optionally a status, deadline, description, and organization), and it creates the tender in the default Open state, stamped with the authenticated user as createdBy. Use it whenever the organization wants to buy through competitive quotes rather than a fixed supplier.
Add Offer
addOffer records one supplier's bid on an tender by pushing an entry into the tender's embedded offers array. Use it for each bid received while the tender is still Open โ this is how a procurement officer collects competing quotes before choosing a winner.
Award Tender
award closes the bidding on a tender by declaring one supplier the winner: it flips the tender's status to Awarded. The winning supplier must have already submitted an offer โ the act validates the choice against the embedded offers[] before committing. Use it at the end of the tendering process, when the procurement officer has picked the best bid.
Get Tenders
getTenders lists the tender collection, newest first, with optional filters by status and organization. Use it to browse the auction board โ which tenders are Open (still taking offers), Awarded, or Closed โ and to inspect the offers that have come in for each one.