Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(debtor): add amount to BaseFineHandoutEventResponse #480

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/controller/response/debtor-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ export interface FineResponse extends BaseResponse {
* @typedef {allOf|BaseResponse} BaseFineHandoutEventResponse
* @property {string} referenceDate.required - Reference date of fines
* @property {BaseUserResponse} createdBy.required - User that handed out the fines
* @property {number} count.required - The amount of fines that were handed out
*/
export interface BaseFineHandoutEventResponse extends BaseResponse {
referenceDate: string;
createdBy: BaseUserResponse;
count: number;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/service/debtor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default class DebtorService extends WithManager {
updatedAt: e.updatedAt.toISOString(),
referenceDate: e.referenceDate.toISOString(),
createdBy: parseUserToBaseResponse(e.createdBy, false),
count: e.fines ? e.fines.length : 0,
};
}

Expand Down Expand Up @@ -269,6 +270,7 @@ export default class DebtorService extends WithManager {
referenceDate: fineHandoutEvent1.referenceDate.toISOString(),
createdBy: parseUserToBaseResponse(fineHandoutEvent1.createdBy, false),
fines: fines1.map((f) => DebtorService.asFineResponse(f)),
count: fines1.length,
};
}

Expand Down
Loading