Allow testers to attach evidence files to a single test case within a specific test run, proving the test was actually executed. Attachments are scoped to the RunCase (per-execution), not the shared case definition. Backend: - runCaseAttachments join table + model (CASCADE on runCase/attachment) - POST/GET /runcaseattachments routes (reuse /attachments download+delete) Frontend: - new "Test record" tab in the run case detail pane with drag-and-drop upload, scoped to reporters; i18n for all 6 locales Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
654 B
JavaScript
28 lines
654 B
JavaScript
function defineRunCaseAttachment(sequelize, DataTypes) {
|
|
const RunCaseAttachment = sequelize.define('RunCaseAttachment', {
|
|
runCaseId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
},
|
|
attachmentId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
},
|
|
});
|
|
|
|
RunCaseAttachment.associate = (models) => {
|
|
RunCaseAttachment.belongsTo(models.RunCase, {
|
|
foreignKey: 'runCaseId',
|
|
onDelete: 'CASCADE',
|
|
});
|
|
RunCaseAttachment.belongsTo(models.Attachment, {
|
|
foreignKey: 'attachmentId',
|
|
onDelete: 'CASCADE',
|
|
});
|
|
};
|
|
|
|
return RunCaseAttachment;
|
|
}
|
|
|
|
export default defineRunCaseAttachment;
|