feat: add file storage service and update configurations
refactor: migrate to tsup for builds and update tsconfigs fix: update error handling and validation in payment service chore: update package scripts and dependencies docs: update README and env examples
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { AppError, createAppError } from '@repo/exceptions';
|
||||
import { AppError, createAppError } from "@repo/exceptions";
|
||||
|
||||
export enum PaymentErrorCode {
|
||||
PAYMENT_NOT_FOUND = 'PAYMENT_NOT_FOUND',
|
||||
PAYMENT_ALREADY_PROCESSED = 'PAYMENT_ALREADY_PROCESSED',
|
||||
PAYMENT_NOT_FOUND = "PAYMENT_NOT_FOUND",
|
||||
PAYMENT_ALREADY_PROCESSED = "PAYMENT_ALREADY_PROCESSED",
|
||||
}
|
||||
|
||||
export type PaymentError = AppError<PaymentErrorCode>;
|
||||
@@ -10,11 +10,11 @@ export type PaymentError = AppError<PaymentErrorCode>;
|
||||
export const paymentNotFound = (paymentId: string): PaymentError =>
|
||||
createAppError<PaymentErrorCode>(
|
||||
PaymentErrorCode.PAYMENT_NOT_FOUND,
|
||||
`Payment with id ${paymentId} not found`
|
||||
`Payment with id ${paymentId} not found`,
|
||||
) as PaymentError;
|
||||
|
||||
export const paymentAlreadyProcessed = (paymentId: string): PaymentError =>
|
||||
createAppError(
|
||||
PaymentErrorCode.PAYMENT_ALREADY_PROCESSED,
|
||||
`Payment ${paymentId} has already been processed`
|
||||
`Payment ${paymentId} has already been processed`,
|
||||
) as PaymentError;
|
||||
|
||||
Reference in New Issue
Block a user