2023-11-20 00:48:40 +03:00
|
|
|
import { CrudController } from "../../core/controllers/crud_controller";
|
2023-11-27 12:13:54 +03:00
|
|
|
import {
|
|
|
|
CallbackStrategyWithEmpty,
|
|
|
|
ResponseBase,
|
|
|
|
} from "../../core/controllers/http_controller";
|
|
|
|
import { Result } from "../../core/helper/result";
|
2023-11-20 00:48:40 +03:00
|
|
|
import { CreateNewProjectInstanceScenario } from "./create_new_project_scenario";
|
|
|
|
import {
|
|
|
|
ProjectInstanceDbModel,
|
|
|
|
ProjectInstanceValidationModel,
|
|
|
|
} from "./project_instance_model";
|
2023-11-27 12:13:54 +03:00
|
|
|
import { UploadCadFileToProjectUseCase } from "./upload_file_to_project_usecase";
|
2023-11-20 00:48:40 +03:00
|
|
|
|
|
|
|
export class ProjectInstancePresentation extends CrudController<
|
|
|
|
ProjectInstanceValidationModel,
|
|
|
|
typeof ProjectInstanceDbModel
|
|
|
|
> {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
validationModel: ProjectInstanceValidationModel,
|
|
|
|
url: "project_instance",
|
|
|
|
databaseModel: ProjectInstanceDbModel,
|
|
|
|
});
|
|
|
|
super.post(new CreateNewProjectInstanceScenario().call);
|
2023-11-27 12:13:54 +03:00
|
|
|
|
|
|
|
super.subRoutes = [
|
|
|
|
{
|
|
|
|
method: "post",
|
|
|
|
subUrl: "upload",
|
|
|
|
fn: new TestUseCase(),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class TestUseCase extends CallbackStrategyWithEmpty {
|
|
|
|
async call(): ResponseBase {
|
|
|
|
return Result.ok(200);
|
2023-11-20 00:48:40 +03:00
|
|
|
}
|
|
|
|
}
|