feat: Billing Service (#14756)

* chore: Billing Service

* chore: others

* chore: don't type

* chore: typo

* chore: use proper wh secret

* chore: updates

* chore: lockfile

* chore: docs and comment out

* chore: updates and include plan

* chore: config

* chore: bring back alias

* chore: update lockfile

* chore: refactor

* chore: default none plan in db

* chore: read from env vars

* chore: feedback

* chore: remove json config

* chore: proper type
This commit is contained in:
Erik authored and GitHub committed 2024-04-30 20:02:04 +00:00
1 parent a51024e915
commit 1cfd2f7053
38 files changed
+664 -133

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ export const V2_ENDPOINTS = {
export const SUCCESS_STATUS = "success";
export const ERROR_STATUS = "error";
export const REDIRECT_STATUS = "redirect";
// Client Errors (4xx)
export const BAD_REQUEST = "BAD_REQUEST";
export const UNAUTHORIZED = "UNAUTHORIZED";
+9 -1
View File
@@ -2,7 +2,12 @@ import { Transform } from "class-transformer";
import { IsNumber, Min, Max, IsOptional } from "class-validator";
import type { Response as BaseResponse } from "express";
import type { ERROR_STATUS, SUCCESS_STATUS, API_ERROR_CODES } from "@calcom/platform-constants";
import type {
ERROR_STATUS,
SUCCESS_STATUS,
API_ERROR_CODES,
REDIRECT_STATUS,
} from "@calcom/platform-constants";
export type ApiSuccessResponse<T> = { status: typeof SUCCESS_STATUS; data: T };
export type ApiSuccessResponseWithoutData = { status: typeof SUCCESS_STATUS };
@@ -23,6 +28,7 @@ export type ApiErrorResponse = {
};
export type ApiRedirectResponseType = {
status: typeof REDIRECT_STATUS;
url: string;
};
@@ -32,6 +38,8 @@ export type ApiResponse<T = undefined> = T extends undefined
? ApiSuccessResponseWithoutData | ApiErrorResponse
: ApiSuccessResponse<T> | ApiErrorResponse;
export type ApiResponseMaybeRedirect<T = undefined> = ApiResponse<T> | ApiRedirectResponseType;
export class Pagination {
@Transform(({ value }: { value: string }) => value && parseInt(value))
@IsNumber()