- add optional description to scenario and environment entities - expose description in create/update DTOs, MCP tools, and export DTOs - render description as markdown on detail pages - add description editor (CodeEditor) to create/edit forms for both resources
41 lines
846 B
TypeScript
41 lines
846 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
OneToMany,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
} from "typeorm";
|
|
import { ScenarioCredentialEntity } from "./scenario-credential.entity";
|
|
import { ScenarioStepEntity } from "./scenario-step.entity";
|
|
|
|
@Entity("scenarios")
|
|
export class ScenarioEntity {
|
|
@PrimaryGeneratedColumn("uuid")
|
|
id: string;
|
|
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column("text", { nullable: true })
|
|
description: string | null;
|
|
|
|
@OneToMany(() => ScenarioStepEntity, (step) => step.scenario, {
|
|
cascade: true,
|
|
eager: false,
|
|
})
|
|
steps: ScenarioStepEntity[];
|
|
|
|
@OneToMany(() => ScenarioCredentialEntity, (sc) => sc.scenario, {
|
|
cascade: true,
|
|
eager: false,
|
|
})
|
|
scenarioCredentials: ScenarioCredentialEntity[];
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
}
|