Skip to main content

Class: InflowsController

Controller handling all inflow-related HTTP endpoints. Provides REST API endpoints for managing income transactions. All endpoints require authentication via JWT.

Constructors

new InflowsController()

new InflowsController(inflowsService): InflowsController

Parameters

inflowsService

InflowsService

Returns

InflowsController

Methods

create()

create(request, createInflowDto): Promise<InflowDto>

Creates a new inflow record

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

createInflowDto

CreateInflowDto

The inflow data to create

Returns

Promise<InflowDto>

The created inflow record


findAll()

findAll(request, page?, limit?, search?, tags?): Promise<InflowSearchDto>

Retrieves all inflows with optional filtering and pagination

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

page?

number

Page number for pagination

limit?

number

Number of items per page

string

Search term for filtering

tags?

string[]

Array of tags to filter by

Returns

Promise<InflowSearchDto>

Paginated list of inflows


findOne()

findOne(request, id): Promise<any>

Retrieves a specific inflow by ID

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

id

string

The ID of the inflow to retrieve

Returns

Promise<any>

The requested inflow record


update()

update(request, id, updateInflowDto): Promise<any>

Updates an existing inflow record

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

id

string

The ID of the inflow to update

updateInflowDto

UpdateInflowDto

The data to update

Returns

Promise<any>

The updated inflow record


remove()

remove(request, id): Promise<any>

Deletes an inflow record

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

id

string

The ID of the inflow to delete

Returns

Promise<any>

The deleted inflow record


getTotalInflow()

getTotalInflow(request): Promise<any>

Retrieves the total amount of all inflows

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

Returns

Promise<any>

The total amount of all inflows


getTagStats()

getTagStats(request): Promise<TagStatistics[]>

Retrieves statistics about inflow tags

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

Returns

Promise<TagStatistics[]>

Array of tag statistics


getMonthlyStats()

getMonthlyStats(request, year): Promise<MonthlyStats[]>

Retrieves monthly statistics for a specific year

Parameters

request

RequestWithUser

The HTTP request containing the authenticated user

year

number

The year to get statistics for

Returns

Promise<MonthlyStats[]>

Array of monthly statistics