Skip to content

API — Grant

The HTTP surface of projects, budgets, allocations and exchange rates. ProjectController owns the project record that every other module reads; MasterBudgetController and BudgetLinesController own the planned-versus-actual budget; AllocationsController spreads a salary across budget lines for a month.

See Grant module.

84 actions across 5 controllers

Routing, the permission model, response kinds and error behaviour are described once in the API Overview. Unless a row says otherwise the route is /{Controller}/{Action}, id is a GUID string, and a Details page is a full View while Manage* / Create fragments are PartialViews loaded into a modal.

ProjectController

Donor-funded projects: the project record, places, donors, programmes, extensions, month details and per-project access.

Source: NKO.Main/NKO.Main/Controllers/ProjectController.cs · route prefix: /Project · 22 actions

Route Verb Parameters Permission Returns
/Project/AddExtension GET string id ProjectAddExtension PartialView
/Project/AddExtension POST ProjectExtensions Model ProjectAddExtension PartialView / JSON
/Project/Allocations GET string id ProjectAllocations View
/Project/Create GET — ProjectCreate View
/Project/Create POST Project model, List<int> Places, List<int> Donors, List<int> Programs, List<ProjectAttachments> ProjectAttachments ProjectCreate View / Redirect
/Project/CreateAttachment GET string id, int? fileType PurchaseRequestAddComment PartialView
/Project/CreateAttachment POST string id, string Description, int FileTypeId PurchaseRequestAddComment PartialView / JSON
/Project/Delete GET string id, int? Redir ProjectDeleteActivity PartialView / Redirect
/Project/Delete POST Project model, int? Redir ProjectDeleteActivity PartialView / JSON
/Project/DeleteAttachment GET string id HumanResourceDeleteAttachment PartialView / Redirect
/Project/DeleteAttachment POST ArchiveFile model HumanResourceDeleteAttachment JSON
/Project/Details GET string id, int? extId ProjectDetails View / Redirect
/Project/Edit GET string id, int? extId ProjectEdit View / Redirect
/Project/Edit POST Project model, List<int> Places, List<int> Donors, List<int> Programs, List<ProjectAttachments> ProjectAttachments ProjectEdit View / Redirect
/Project/EditExtension GET int? id ProjectEditExtension PartialView / Redirect
/Project/EditExtension POST ProjectExtensions ext ProjectEditExtension PartialView / JSON
/Project/EditMonth GET string id ProjectEditMonth PartialView
/Project/EditMonth POST ProjectMonths model ProjectEditMonth PartialView / JSON
/Project/Export GET — ProjectExport View
/Project/Export POST int month, int year ProjectExport Redirect
/Project GET int? StatusId, int? Year, int? page, string projectName, int? donorId, int? programId, string sortOrder, int? statusFilter, int? yearFilter ProjectIndex View
/Project/UploadFiles POST int id PurchaseRequestAddComment JSON

MasterBudgetController

The Master Budget, its detail lines and the generated monthly breakdown, plus the allocation-cost forecast.

Source: NKO.Main/NKO.Main/Controllers/MasterBudgetController.cs · route prefix: /MasterBudget · 23 actions · 1 ungated

Route Verb Parameters Permission Returns
/MasterBudget/AllocationBase GET string sortOrder, string currentFilter, string hiddenDateRange, int? page MasterBudgetCreate View
/MasterBudget/AllocationCosts GET string id, int? projectId, bool? export MasterBudgetIndex View
/MasterBudget/Create GET — MasterBudgetCreate View
/MasterBudget/Create POST MasterBudget model MasterBudgetCreate View / Redirect
/MasterBudget/CreateMBDetails GET string id MasterBudgetCreate PartialView
/MasterBudget/CreateMBDetails POST MasterBudgetDetails model MasterBudgetCreate PartialView / JSON
/MasterBudget/CreateMBMonthDetails GET string id MasterBudgetCreate PartialView
/MasterBudget/CreateMBMonthDetails POST MasterBudgetDetails model MasterBudgetCreate PartialView / JSON
/MasterBudget/Details GET string id, int? page MasterBudgetDetails View
/MasterBudget/DownloadTemplate GET — — open File
/MasterBudget/Edit GET string id MasterBudgetCreate PartialView
/MasterBudget/Edit POST MasterBudget model MasterBudgetCreate PartialView / JSON
/MasterBudget/EditDetails GET string id MasterBudgetCreate PartialView
/MasterBudget/EditDetails POST MasterBudgetDetails model MasterBudgetCreate PartialView / JSON
/MasterBudget/EditMonth GET string id MasterBudgetCreate PartialView
/MasterBudget/EditMonth POST MasterBudgetDetailsMonths model MasterBudgetCreate PartialView / JSON
/MasterBudget/ExportMBDetails GET string id MasterBudgetDetails Redirect
/MasterBudget/FullMasterBudget GET string sortOrder, string currentFilter, string hiddenDateRange, int? page MasterBudgetCreate View
/MasterBudget/GetMBDetailsCodes GET string search General JSON
/MasterBudget/ImportMBDetails GET string id MasterBudgetCreate PartialView
/MasterBudget/ImportMBDetails POST IFormFile file, string masterBudgetGuid MasterBudgetCreate JSON
/MasterBudget GET int? type, int? page MasterBudgetIndex View
/MasterBudget/MonthDetails GET string id, int? page MasterBudgetDetails View

BudgetLinesController

Actual budget lines, procurement budget lines, employee coverage and the budget consumption report.

Source: NKO.Main/NKO.Main/Controllers/BudgetLinesController.cs · route prefix: /BudgetLines · 18 actions · 1 ungated

Route Verb Parameters Permission Returns
/BudgetLines/Create GET string id BudgetLinesCreate View
/BudgetLines/Create POST ProcBudgetLineCreateVM model BudgetLinesCreate View / Redirect
/BudgetLines/Delete GET string id BudgetLinesDelete PartialView / Redirect
/BudgetLines/Delete POST ProcBudgetLineVM model BudgetLinesDelete PartialView / JSON
/BudgetLines/Details GET string id, int? extId BudgetLinesDetails View
/BudgetLines/DownloadTemplate GET — — open File
/BudgetLines/Edit GET string id BudgetLinesCreate View / Redirect
/BudgetLines/Edit POST ProcBudgetLineCreateVM model BudgetLinesCreate View / Redirect
/BudgetLines/Employees GET int? month, int? year, int? page, int? countryId, int? departmentId, int? employeeId, string sortOrder, int? minAllocation, int? maxAllocation, int? levelId BudgetLinesIndex View
/BudgetLines/Export GET int? projectId, int? categoryId, string code, string page BudgetLinesIndex Redirect
/BudgetLines/ExportEmployees GET int? month, int? year, int? page, int? countryId, int? departmentId, int? employeeId, string sortOrder, int? minAllocation, int? maxAllocation, int? levelId BudgetLinesIndex View
/BudgetLines/GetAllList GET int id General JSON
/BudgetLines/GetList GET string search, int id General JSON
/BudgetLines/GetListForSRF GET string search, int id General JSON
/BudgetLines/Import GET int? projectId BudgetLinesCreate PartialView
/BudgetLines/Import POST ImportVM importVM, IFormFile file BudgetLinesCreate JSON
/BudgetLines GET int? type, int? ProjectId, string sortOrder, int? CatId, string code, int? page BudgetLinesIndex View
/BudgetLines/ProcBudgetLines GET string id, string sortOrder, string code, int? page BudgetLinesIndex View

AllocationsController

Salary allocation of an employee across project budget lines for a given month.

Source: NKO.Main/NKO.Main/Controllers/AllocationsController.cs · route prefix: /Allocations · 13 actions

Route Verb Parameters Permission Returns
/Allocations/Allocate GET string id, string msg AllocationsIndex View
/Allocations/Allocate POST EmployeeAllocationVM model, int year, int month, int userId AllocationsIndex Redirect
/Allocations/Create GET — AllocationsIndex View
/Allocations/Create POST AllocationsViewModel appUserAllocation AllocationsIndex View / Redirect
/Allocations/Delete GET int id AllocationsIndex PartialView / Redirect
/Allocations/Delete POST AllocationsViewModel model AllocationsIndex PartialView / Redirect
/Allocations/Details GET int id, int? extId AllocationsIndex View
/Allocations/Edit GET int id AllocationsIndex View
/Allocations/Edit POST AllocationsViewModel allocationView AllocationsIndex View / Redirect
/Allocations/GetBudgetLines GET string search, int id AllocationsIndex JSON
/Allocations GET int? page AllocationsIndex View
/Allocations/Salary GET — AllocationsIndex View
/Allocations/Salary POST SalaryViewModel salaryViewModel AllocationsIndex View

ExchangeRateController

The global exchange-rate row and the per-donor rate tables.

Source: NKO.Main/NKO.Main/Controllers/ExchangeRateController.cs · route prefix: /ExchangeRate · 8 actions

Route Verb Parameters Permission Returns
/ExchangeRate/CreateExchangeRate GET int donorId ExchangeRateIndex View
/ExchangeRate/CreateExchangeRate POST DonorExchangeRate model ExchangeRateIndex View / JSON
/ExchangeRate/Delete GET int id ExchangeRateIndex View
/ExchangeRate/Delete POST DonorExchangeRate model ExchangeRateIndex View / JSON
/ExchangeRate/EditExchangeRate GET int id ExchangeRateIndex View
/ExchangeRate/EditExchangeRate POST DonorExchangeRate model ExchangeRateIndex View / JSON
/ExchangeRate/ExchangeRates GET string id, int? page ExchangeRateIndex View
/ExchangeRate GET int? type, int? page ExchangeRateIndex View