booking flow,summtion, approval, contract, mock payemnt and integration to back office, and also add permissions

This commit is contained in:
marshal
2026-06-05 10:38:31 +03:00
parent 810bbc1168
commit d226d7ef22
94 changed files with 3509 additions and 1042 deletions

View File

@@ -3,7 +3,9 @@ import {
ExecutionContext,
Injectable,
NestInterceptor,
StreamableFile,
} from "@nestjs/common";
import { Readable } from "stream";
import { Observable } from "rxjs";
import { map } from "rxjs/operators";
@@ -16,18 +18,28 @@ export interface StandardResponse<T> {
@Injectable()
export class ResponseTransformInterceptor<T> implements NestInterceptor<
T,
StandardResponse<T>
StandardResponse<T> | T
> {
intercept(
_context: ExecutionContext,
next: CallHandler<T>,
): Observable<StandardResponse<T>> {
): Observable<StandardResponse<T> | T> {
return next.handle().pipe(
map((data) => ({
success: true,
data,
timestamp: new Date().toISOString(),
})),
map((data) => {
if (
data instanceof StreamableFile ||
data instanceof Buffer ||
data instanceof Readable
) {
return data;
}
return {
success: true,
data,
timestamp: new Date().toISOString(),
};
}),
);
}
}