add server to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 11:57:50 +02:00
parent 28e309981b
commit 80b97b5fdc
1303 changed files with 137049 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
class HttpException extends Error {
public status: number;
public message: string;
constructor(status: number, message: string) {
super(message);
this.status = status;
this.message = message;
}
}

View File

@@ -0,0 +1,8 @@
export default class ModelEntityNotFound extends Error {
constructor(entityId, message?) {
message = message || `Entity with id ${entityId} does not exist`;
super(message);
}
}

View File

@@ -0,0 +1,8 @@
export default class NoPaymentModelWithPricedPlan {
constructor() {
}
}

View File

@@ -0,0 +1,8 @@
export default class NotAllowedChangeSubscriptionPlan {
constructor() {
this.name = "NotAllowedChangeSubscriptionPlan";
}
}

View File

@@ -0,0 +1,7 @@
export default class PaymentAmountInvalidWithPlan{
constructor() {
}
}

View File

@@ -0,0 +1,5 @@
export default class PaymentInputInvalid {
constructor() {}
}

View File

@@ -0,0 +1,14 @@
export default class ServiceError {
errorType: string;
message: string;
payload: any;
constructor(errorType: string, message?: string, payload?: any) {
this.errorType = errorType;
this.message = message || null;
this.payload = payload;
}
}

View File

@@ -0,0 +1,15 @@
import ServiceError from './ServiceError';
export default class ServiceErrors {
errors: ServiceError[];
constructor(errors: ServiceError[]) {
this.errors = errors;
}
hasType(errorType: string) {
return this.errors
.some((error: ServiceError) => error.errorType === errorType);
}
}

View File

@@ -0,0 +1,7 @@
export default class TenantAlreadyInitialized {
constructor() {
}
}

View File

@@ -0,0 +1,9 @@
export default class TenantAlreadySeeded {
constructor() {
}
}

View File

@@ -0,0 +1,9 @@
export default class TenantDBAlreadyExists {
constructor() {
}
}

View File

@@ -0,0 +1,7 @@
export default class TenantDatabaseNotBuilt {
constructor() {
}
}

View File

@@ -0,0 +1,6 @@
export default class VoucherCodeRequired {
constructor() {
this.name = 'VoucherCodeRequired';
}
}

View File

@@ -0,0 +1,25 @@
import NotAllowedChangeSubscriptionPlan from './NotAllowedChangeSubscriptionPlan';
import ServiceError from './ServiceError';
import ServiceErrors from './ServiceErrors';
import NoPaymentModelWithPricedPlan from './NoPaymentModelWithPricedPlan';
import PaymentInputInvalid from './PaymentInputInvalid';
import PaymentAmountInvalidWithPlan from './PaymentAmountInvalidWithPlan';
import TenantAlreadyInitialized from './TenantAlreadyInitialized';
import TenantAlreadySeeded from './TenantAlreadySeeded';
import TenantDBAlreadyExists from './TenantDBAlreadyExists';
import TenantDatabaseNotBuilt from './TenantDatabaseNotBuilt';
import VoucherCodeRequired from './VoucherCodeRequired';
export {
NotAllowedChangeSubscriptionPlan,
NoPaymentModelWithPricedPlan,
PaymentAmountInvalidWithPlan,
ServiceError,
ServiceErrors,
PaymentInputInvalid,
TenantAlreadyInitialized,
TenantAlreadySeeded,
TenantDBAlreadyExists,
TenantDatabaseNotBuilt,
VoucherCodeRequired,
};