feat: add TallyNote local reimbursement ledger
TallyNote release / linux-x64 (push) Failing after 2m41s

This commit is contained in:
Qiufeng
2026-08-29 01:02:29 +08:00
commit 9719429f4a
62 changed files with 29200 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import type { FastifyRequest } from "fastify";
export class AppError extends Error {
constructor(
public readonly statusCode: number,
public readonly code: string,
message: string,
public readonly details?: unknown,
) {
super(message);
}
}
export function errorPayload(request: FastifyRequest, error: AppError) {
return {
error: {
code: error.code,
message: error.message,
requestId: request.id,
...(error.details === undefined ? {} : { details: error.details }),
},
};
}
export function notFound(message = "没有找到对应内容"): never {
throw new AppError(404, "NOT_FOUND", message);
}