This repository has been archived on 2020-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
requestor/lib/classes/transaction.ts
Timo Hocker 715f64408d fix
2020-04-08 15:54:31 +02:00

31 lines
775 B
TypeScript

import { Request, Response } from '@types/express/index.d.ts';
import Status from './Status.ts';
import Session from './Session.ts';
export default class Transaction {
/* private */
private _req: Request;
private _res: Response;
private _status: Status;
/* public */
public get req (): Request { return this._req; }
public get res (): Response { return this._res; }
public get status (): Status { return this._status; }
public session: Session;
/* constructor */
public constructor (req: Request, res: Response) {
this._req = req;
this._res = res;
this._status = new Status;
}
/* methods */
public finalize (): void {
if (this._status.has_status ())
this._res.status (this.status.status);
this._res.end (data);
}
}