بنقرة واحدة
add-entity
Add a new database entity with migrations for all three databases (MySQL, MSSQL, PostgreSQL)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add a new database entity with migrations for all three databases (MySQL, MSSQL, PostgreSQL)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | add-entity |
| description | Add a new database entity with migrations for all three databases (MySQL, MSSQL, PostgreSQL) |
| disable-model-invocation | false |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
Add a new database entity to the OMS system with proper multi-database support.
When the user requests to add a new entity (e.g., "add a Product entity"), follow these steps:
backend/omsapi/Models/Entities/{EntityName}Entity.csBaseEntity (includes Id, CreatedAt, UpdatedAt, OrgId)namespace omsapi.Models.Entities
{
/// <summary>
/// {Entity description}
/// </summary>
public class {EntityName}Entity : BaseEntity
{
/// <summary>
/// Property description
/// </summary>
public string PropertyName { get; set; } = string.Empty;
// Add navigation properties if needed
}
}
backend/omsapi/Data/OmsContext.csbackend/omsapi/Data/OmsPgContext.cspublic DbSet<{EntityName}Entity> {EntityName}s { get; set; }OnModelCreating if needed (indexes, relationships, etc.)CRITICAL: Must create migrations for ALL THREE databases:
database/mysql/V{next_version}_Add_{EntityName}_Table.sqldatabase/mssql/V{next_version}_Add_{EntityName}_Table.sqldatabase/postgresql/V{next_version}_Add_{EntityName}_Table.sqlMigration Template:
-- MySQL
CREATE TABLE `{table_name}` (
`Id` BIGINT AUTO_INCREMENT PRIMARY KEY,
`OrgId` BIGINT NOT NULL,
`CreatedAt` DATETIME(6) NOT NULL,
`UpdatedAt` DATETIME(6) NOT NULL,
-- Add custom fields here
INDEX `IX_{table_name}_OrgId` (`OrgId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- SQL Server
CREATE TABLE [{table_name}] (
[Id] BIGINT IDENTITY(1,1) PRIMARY KEY,
[OrgId] BIGINT NOT NULL,
[CreatedAt] DATETIME2 NOT NULL,
[UpdatedAt] DATETIME2 NOT NULL,
-- Add custom fields here
INDEX [IX_{table_name}_OrgId] ([OrgId])
);
-- PostgreSQL
CREATE TABLE "{table_name}" (
"Id" BIGSERIAL PRIMARY KEY,
"OrgId" BIGINT NOT NULL,
"CreatedAt" TIMESTAMP NOT NULL,
"UpdatedAt" TIMESTAMP NOT NULL,
-- Add custom fields here
);
CREATE INDEX "IX_{table_name}_OrgId" ON "{table_name}" ("OrgId");
{EntityName}Entity for class, {table_name} for database tableAdd a new API endpoint with controller, service, and DTOs following OMS patterns
Add a new mobile page to frontend.h5 using Vant 4 components
Add a new frontend page with proper layout, table, and API integration following OMS UI standards
Audit backend code to ensure all queries properly filter by OrgId for multi-tenant security
Debug and troubleshoot issues in the OMS system with systematic approach
Create database migration files for all three databases (MySQL, MSSQL, PostgreSQL) when schema changes are needed