webstudio/server/src/features/project_instance/project_instance_presentation.ts

26 lines
933 B
TypeScript
Raw Normal View History

2023-11-20 00:48:40 +03:00
import { CrudController } from "../../core/controllers/crud_controller";
2023-12-03 16:16:08 +03:00
import { CreateNewProjectInstanceScenario } from "./domain/create_new_project_scenario";
import { UploadCadFileToProjectScenario } from "./domain/upload_file_to_to_project_scenario";
import { ProjectInstanceDbModel } from "./models/project_instance_database_model";
import { ProjectInstanceValidationModel } from "./models/project_instance_validation_model";
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
2023-12-22 21:07:55 +03:00
this.subRoutes.push({
method: "POST",
subUrl: "upload",
fn: new UploadCadFileToProjectScenario(),
});
2023-11-27 12:13:54 +03:00
}
}