@autobe/agent 0.27.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +1 -1
  2. package/lib/context/assertSchemaModel.d.ts +1 -1
  3. package/lib/context/assertSchemaModel.js +4 -7
  4. package/lib/context/assertSchemaModel.js.map +1 -1
  5. package/lib/index.mjs +18186 -7689
  6. package/lib/index.mjs.map +1 -1
  7. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
  8. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  9. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +164 -86
  10. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  11. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +656 -335
  12. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  13. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +143 -74
  14. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  15. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +17 -52
  16. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +25 -22
  17. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +7 -23
  18. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +165 -2
  19. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  20. package/lib/orchestrate/facade/createAutoBeFacadeController.js +773 -403
  21. package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -1
  22. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +749 -2
  23. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  24. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1637 -9
  25. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  26. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +252 -133
  27. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  28. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +258 -135
  29. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
  30. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +342 -226
  31. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  32. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +633 -1
  33. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  34. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +785 -3
  35. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  36. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +206 -3
  37. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
  38. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +107 -1
  39. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  40. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1676 -9
  41. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  42. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1637 -9
  43. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  44. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +397 -201
  45. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  46. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1184 -599
  47. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  48. package/lib/orchestrate/prisma/orchestratePrismaReview.js +1202 -608
  49. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  50. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +4 -2
  51. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  52. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +369 -185
  53. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  54. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +405 -203
  55. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  56. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +130 -2
  57. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  58. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +165 -2
  59. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  60. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +130 -2
  61. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  62. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  63. package/lib/orchestrate/test/orchestrateTestCorrect.js +131 -2
  64. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  65. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +166 -2
  66. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  67. package/lib/orchestrate/test/orchestrateTestScenario.js +257 -3
  68. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  69. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +283 -3
  70. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  71. package/lib/orchestrate/test/orchestrateTestWrite.js +139 -2
  72. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  73. package/package.json +9 -9
  74. package/src/constants/AutoBeSystemPromptConstant.ts +1 -1
  75. package/src/context/assertSchemaModel.ts +5 -8
  76. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +7 -9
  77. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -9
  78. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +7 -9
  79. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +19 -54
  80. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +25 -22
  81. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +8 -24
  82. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +15 -1
  83. package/src/orchestrate/facade/createAutoBeFacadeController.ts +7 -6
  84. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +11 -1
  85. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +11 -1
  86. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
  87. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +13 -9
  88. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +17 -14
  89. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -1
  90. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +14 -1
  91. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +11 -1
  92. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +9 -1
  93. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +14 -1
  94. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +11 -1
  95. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +13 -9
  96. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +7 -9
  97. package/src/orchestrate/prisma/orchestratePrismaReview.ts +7 -10
  98. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +13 -9
  99. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +13 -9
  100. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +11 -1
  101. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +15 -1
  102. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -1
  103. package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +5 -1
  104. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +1 -1
  105. package/src/orchestrate/test/orchestrateTestCorrect.ts +11 -1
  106. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +18 -1
  107. package/src/orchestrate/test/orchestrateTestScenario.ts +11 -1
  108. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +11 -1
  109. package/src/orchestrate/test/orchestrateTestWrite.ts +11 -1
@@ -126,7 +126,11 @@ function step(ctx, props) {
126
126
  }
127
127
  function createController(ctx, props) {
128
128
  (0, assertSchemaModel_1.assertSchemaModel)(ctx.model);
129
- const application = collection[ctx.model];
129
+ const application = collection[ctx.model === "chatgpt"
130
+ ? "chatgpt"
131
+ : ctx.model === "gemini"
132
+ ? "gemini"
133
+ : "claude"];
130
134
  return {
131
135
  protocol: "class",
132
136
  name: "Prisma Schema Review",
@@ -138,607 +142,6 @@ function createController(ctx, props) {
138
142
  },
139
143
  };
140
144
  }
141
- const claude = {
142
- model: "claude",
143
- options: {
144
- reference: true,
145
- separate: null
146
- },
147
- functions: [
148
- {
149
- name: "reviewSchemaFile",
150
- parameters: {
151
- description: "Current Type: {@link IAutoBePrismaReviewApplication.IProps}",
152
- type: "object",
153
- properties: {
154
- review: {
155
- description: "Comprehensive review analysis of the proposed schema modifications.\n\nContains the AI agent's detailed evaluation of the schema changes,\nincluding validation of normalization compliance, relationship integrity,\nindex optimization, and business requirement alignment. The review\nidentifies potential issues and confirms adherence to best practices.\n\n**Review Dimensions:**\n\n- **Normalization Validation**: Confirms 3NF compliance and proper data\n structure\n- **Relationship Integrity**: Validates foreign key references and\n cardinality\n- **Performance Optimization**: Reviews indexing strategy and query\n patterns\n- **Business Logic Alignment**: Ensures schema supports all use cases\n- **Naming Conventions**: Verifies consistent naming patterns\n- **Data Type Consistency**: Confirms appropriate field types\n- **Temporal Field Handling**: Validates audit trail implementation\n\n**Example:**\n\n \"After reviewing the schema modifications:\n 1. All tables properly implement UUID primary keys\n 2. Foreign key relationships correctly reference existing models\n 3. Composite indexes optimize for common query patterns\n 4. Snapshot tables include proper temporal fields\n 5. Materialized views (mv_) contain appropriate denormalization\n The schema follows all best practices and is ready for implementation.\"",
156
- type: "string"
157
- },
158
- plan: {
159
- description: "Strategic database design plan that guided the schema creation.\n\nContains the original planning document that outlines the database\narchitecture strategy, including table structures, relationships,\nnormalization approach, and business requirement mapping. This plan\nserves as the blueprint for validating the implemented schema.\n\n**Planning Components:**\n\n- **Business Requirements**: Mapping of business needs to database\n structures\n- **Table Design**: Entity definitions and attribute specifications\n- **Relationship Strategy**: Cardinality and referential integrity planning\n- **Normalization Approach**: Application of 1NF, 2NF, 3NF principles\n- **Performance Considerations**: Index strategy and query optimization\n- **Snapshot Architecture**: Temporal data handling and audit requirements\n- **Materialized Views**: Denormalization strategy for performance\n\n**Example:**\n\n \"Database Design Strategy:\n Component: Sales Domain\n Tables: shopping_sales, shopping_sale_snapshots, shopping_sale_units\n\n Design Approach:\n - Normalize product catalog to 3NF for data integrity\n - Implement snapshot pattern for price history tracking\n - Create composite indexes for product search queries\n - Use materialized views for sales analytics dashboards\"",
160
- type: "string"
161
- },
162
- modifications: {
163
- description: "Array of Prisma models that have been modified based on review feedback.\n\nContains ONLY the models that required changes, not the entire schema.\nEach model represents a complete table definition with all fields,\nrelationships, indexes, and documentation. These modifications will be\napplied to the models to produce the final implementation.\n\n**Model Requirements:**\n\n- **Complete Models**: Each entry must be a complete model definition\n- **Targeted Changes**: Only includes models that need modifications\n- **AST Compliance**: Follows AutoBePrisma.IModel interface structure\n- **Relationship Integrity**: All foreign keys reference valid models\n- **Index Optimization**: Strategic indexes without redundancy\n- **Documentation**: Comprehensive English descriptions\n\n**Notes:**\n\n- Models not included in this array remain unchanged from the models\n- The final schema merges these modifications with the original models\n- All modifications must resolve issues identified in the review",
164
- type: "array",
165
- items: {
166
- $ref: "#/$defs/AutoBePrisma.IModel"
167
- }
168
- }
169
- },
170
- required: [
171
- "review",
172
- "plan",
173
- "modifications"
174
- ],
175
- additionalProperties: false,
176
- $defs: {
177
- "AutoBePrisma.IModel": {
178
- description: "Interface representing a single Prisma model (database table).\n\nBased on the uploaded schemas, models follow specific patterns:\n\n- Main business entities (e.g., shopping_sales, shopping_customers)\n- Snapshot/versioning entities for audit trails (e.g.,\n shopping_sale_snapshots)\n- Junction tables for M:N relationships (e.g.,\n shopping_cart_commodity_stocks)\n- Materialized views for performance (prefixed with mv_)",
179
- type: "object",
180
- properties: {
181
- name: {
182
- description: "Name of the Prisma model (database table name).\n\nMUST use snake_case naming convention. Examples: \"shopping_customers\",\n\"shopping_sale_snapshots\", \"bbs_articles\" Materialized views use \"mv_\"\nprefix: \"mv_shopping_sale_last_snapshots\"",
183
- type: "string",
184
- pattern: "^[a-z][a-z0-9_]*$"
185
- },
186
- description: {
187
- description: "Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using \"{@\\link ModelName}\" syntax\n\n**IMPORTANT**: Description must be written in English. Example: \"Customer\ninformation, but not a person but a **connection** basis...\"",
188
- type: "string"
189
- },
190
- material: {
191
- description: "Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They're marked as \"@\\hidden\" in documentation and prefixed with\n\"mv_\" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices",
192
- type: "boolean"
193
- },
194
- stance: {
195
- description: "Specifies the architectural stance of this model within the database\nsystem.\n\nThis property defines how the table positions itself in relation to other\ntables and what role it plays in the overall data architecture,\nparticularly for API endpoint generation and business logic\norganization.\n\n## Values:\n\n### `\"primary\"` - Main Business Entity\n\nTables that represent core business concepts and serve as the primary\nsubjects of user operations. These tables typically warrant independent\nCRUD API endpoints since users directly interact with these entities.\n\n**Key principle**: If users need to independently create, search, filter,\nor manage entities regardless of their parent context, the table should\nbe primary stance.\n\n**API Requirements:**\n\n- Independent creation endpoints (POST /articles, POST /comments)\n- Search and filtering capabilities across all instances\n- Direct update and delete operations\n- List/pagination endpoints for browsing\n\n**Why `bbs_article_comments` is primary, not subsidiary:**\n\nAlthough comments belong to articles, they require independent\nmanagement:\n\n- **Search across articles**: \"Find all comments by user X across all\n articles\"\n- **Moderation workflows**: \"List all pending comments for review\"\n- **User activity**: \"Show all comments made by this user\"\n- **Independent operations**: Users edit/delete their comments directly\n- **Notification systems**: \"Alert when any comment is posted\"\n\nIf comments were subsidiary, these operations would be impossible or\nrequire inefficient nested queries through parent articles.\n\n**Characteristics:**\n\n- Represents tangible business concepts that users manage\n- Serves as reference points for other tables\n- Requires comprehensive API operations (CREATE, READ, UPDATE, DELETE)\n- Forms the backbone of the application's business logic\n\n**Examples:**\n\n- `bbs_articles` - Forum posts that users create, edit, and manage\n- `bbs_article_comments` - User comments that require independent\n management\n\n### `\"subsidiary\"` - Supporting/Dependent Entity\n\nTables that exist to support primary entities but are not independently\nmanaged by users. These tables are typically managed through their parent\nentities and may not need standalone API endpoints.\n\n**Characteristics:**\n\n- Depends on primary or snapshot entities for context\n- Often managed indirectly through parent entity operations\n- May have limited or no independent API operations\n- Provides supporting data or relationships\n\n**Examples:**\n\n- `bbs_article_snapshot_files` - Files attached to article snapshots\n- `bbs_article_snapshot_tags` - Tags associated with article snapshots\n- `bbs_article_comment_snapshot_files` - Files attached to comment\n snapshots\n\n### `\"snapshot\"` - Historical/Versioning Entity\n\nTables that capture point-in-time states of primary entities for audit\ntrails, version control, or historical tracking. These tables record\nchanges but are rarely modified directly by users.\n\n**Characteristics:**\n\n- Captures historical states of primary entities\n- Typically append-only (rarely updated or deleted)\n- Referenced for audit trails and change tracking\n- Usually read-only from user perspective\n\n**Examples:**\n\n- `bbs_article_snapshots` - Historical states of articles\n- `bbs_article_comment_snapshots` - Comment modification history\n\n## API Generation Guidelines:\n\nThe stance property guides automatic API endpoint generation:\n\n- **`\"primary\"`** \u2192 Generate full CRUD endpoints based on business\n requirements\n- **`\"subsidiary\"`** \u2192 Evaluate carefully; often managed through parent\n entities\n- **`\"snapshot\"`** \u2192 Typically read-only endpoints for historical data\n access",
196
- oneOf: [
197
- {
198
- "const": "primary"
199
- },
200
- {
201
- "const": "subsidiary"
202
- },
203
- {
204
- "const": "snapshot"
205
- }
206
- ]
207
- },
208
- primaryField: {
209
- description: "The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with \"@\\id\"\ndirective. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\nmapping.",
210
- $ref: "#/$defs/AutoBePrisma.IPrimaryField"
211
- },
212
- foreignFields: {
213
- description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
214
- type: "array",
215
- items: {
216
- $ref: "#/$defs/AutoBePrisma.IForeignField"
217
- }
218
- },
219
- plainFields: {
220
- description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
221
- type: "array",
222
- items: {
223
- $ref: "#/$defs/AutoBePrisma.IPlainField"
224
- }
225
- },
226
- uniqueIndexes: {
227
- description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
228
- type: "array",
229
- items: {
230
- $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
231
- }
232
- },
233
- plainIndexes: {
234
- description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
235
- type: "array",
236
- items: {
237
- $ref: "#/$defs/AutoBePrisma.IPlainIndex"
238
- }
239
- },
240
- ginIndexes: {
241
- description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
242
- type: "array",
243
- items: {
244
- $ref: "#/$defs/AutoBePrisma.IGinIndex"
245
- }
246
- }
247
- },
248
- required: [
249
- "name",
250
- "description",
251
- "material",
252
- "stance",
253
- "primaryField",
254
- "foreignFields",
255
- "plainFields",
256
- "uniqueIndexes",
257
- "plainIndexes",
258
- "ginIndexes"
259
- ]
260
- },
261
- "AutoBePrisma.IPrimaryField": {
262
- description: "Interface representing the primary key field of a Prisma model.\n\nAll models in the uploaded schemas use UUID as primary key for better\ndistributed system compatibility and security (no sequential ID exposure).",
263
- type: "object",
264
- properties: {
265
- name: {
266
- description: "Name of the primary key field.\n\nMUST use snake_case naming convention. Consistently named \"id\" across all\nmodels in the uploaded schemas. Represents the unique identifier for each\nrecord in the table.",
267
- type: "string",
268
- pattern: "^[a-z][a-z0-9_]*$"
269
- },
270
- type: {
271
- description: "Data type of the primary key field.\n\nAlways \"uuid\" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.",
272
- "const": "uuid"
273
- },
274
- description: {
275
- description: "Description of the primary key field's purpose.\n\nStandard description is \"Primary Key.\" across all models. Serves as the\nunique identifier for the model instance.\n\n**IMPORTANT**: Description must be written in English.",
276
- type: "string"
277
- }
278
- },
279
- required: [
280
- "name",
281
- "type",
282
- "description"
283
- ]
284
- },
285
- "AutoBePrisma.IForeignField": {
286
- description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
287
- type: "object",
288
- properties: {
289
- name: {
290
- description: "Name of the foreign key field.\n\nMUST use snake_case naming convention. Follows convention:\n\"{target_model_name_without_prefix}_id\" Examples: \"shopping_customer_id\",\n\"bbs_article_id\", \"attachment_file_id\" For self-references: \"parent_id\"\n(e.g., in hierarchical structures)",
291
- type: "string",
292
- pattern: "^[a-z][a-z0-9_]*$"
293
- },
294
- type: {
295
- description: "Data type of the foreign key field.\n\nAlways \"uuid\" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.",
296
- "const": "uuid"
297
- },
298
- description: {
299
- description: "Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: \"Target model's {@\\link\nModelName.id}\" Examples: \"Belonged customer's {@\\link\nshopping_customers.id}\" May include additional context about the\nrelationship's business meaning.\n\n**IMPORTANT**: Description must be written in English.",
300
- type: "string"
301
- },
302
- relation: {
303
- description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
304
- $ref: "#/$defs/AutoBePrisma.IRelation"
305
- },
306
- unique: {
307
- description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
308
- type: "boolean"
309
- },
310
- nullable: {
311
- description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
312
- type: "boolean"
313
- }
314
- },
315
- required: [
316
- "name",
317
- "type",
318
- "description",
319
- "relation",
320
- "unique",
321
- "nullable"
322
- ]
323
- },
324
- "AutoBePrisma.IRelation": {
325
- description: "Interface representing a Prisma relation configuration between models.\n\nThis interface defines how foreign key fields establish relationships with\ntheir target models. It provides the necessary information for Prisma to\ngenerate appropriate relation directives (@relation) in the schema,\nenabling proper relational data modeling and ORM functionality.\n\nThe relation configuration is essential for:\n\n- Generating correct Prisma relation syntax\n- Establishing bidirectional relationships between models\n- Enabling proper type-safe querying through Prisma client\n- Supporting complex relationship patterns (1:1, 1:N, M:N)",
326
- type: "object",
327
- properties: {
328
- name: {
329
- description: "Name of the relation property in the Prisma model.\n\nThis becomes the property name used to access the related model instance\nthrough the Prisma client. Should be descriptive and reflect the business\nrelationship being modeled.\n\nExamples:\n\n- \"customer\" for shopping_customer_id field\n- \"channel\" for shopping_channel_id field\n- \"parent\" for parent_id field in hierarchical structures\n- \"snapshot\" for versioning relationships\n- \"article\" for bbs_article_id field\n\nNaming convention: camelCase, descriptive of the relationship's business\nmeaning",
330
- type: "string",
331
- pattern: "^[a-z][a-zA-Z0-9]*$"
332
- },
333
- targetModel: {
334
- description: "Name of the target model being referenced by this relation.\n\nMust exactly match an existing model name in the schema. This is used by\nPrisma to establish the foreign key constraint and generate the\nappropriate relation mapping.\n\nExamples:\n\n- \"shopping_customers\" for customer relationships\n- \"shopping_channels\" for channel relationships\n- \"bbs_articles\" for article relationships\n- \"attachment_files\" for file attachments\n\nThe target model should exist in the same schema or be accessible through\nthe Prisma schema configuration.",
335
- type: "string"
336
- }
337
- },
338
- required: [
339
- "name",
340
- "targetModel"
341
- ]
342
- },
343
- "AutoBePrisma.IPlainField": {
344
- description: "Interface representing a regular data field that stores business\ninformation.\n\nThese fields contain the actual business data like names, amounts,\ntimestamps, flags, descriptions, and other domain-specific information.",
345
- type: "object",
346
- properties: {
347
- name: {
348
- description: "Name of the field in the database table.\n\nMUST use snake_case naming convention. Common patterns from uploaded\nschemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative",
349
- type: "string",
350
- pattern: "^[a-z][a-z0-9_]*$"
351
- },
352
- type: {
353
- description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Datetime: Timestamp fields with date and time",
354
- oneOf: [
355
- {
356
- "const": "string"
357
- },
358
- {
359
- "const": "boolean"
360
- },
361
- {
362
- "const": "uuid"
363
- },
364
- {
365
- "const": "uri"
366
- },
367
- {
368
- "const": "int"
369
- },
370
- {
371
- "const": "double"
372
- },
373
- {
374
- "const": "datetime"
375
- }
376
- ]
377
- },
378
- description: {
379
- description: "Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes\n\n**IMPORTANT**: Description must be written in English. Example: \"Amount\nof cash payment.\" or \"Whether the unit is required or not.\"",
380
- type: "string"
381
- },
382
- nullable: {
383
- description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
384
- type: "boolean"
385
- }
386
- },
387
- required: [
388
- "name",
389
- "type",
390
- "description",
391
- "nullable"
392
- ]
393
- },
394
- "AutoBePrisma.IUniqueIndex": {
395
- description: "Interface representing a unique index constraint on one or more fields.\n\nUnique indexes enforce data integrity by ensuring no duplicate values exist\nfor the specified field combination. Essential for business rules that\nrequire uniqueness like email addresses, codes, or composite keys.",
396
- type: "object",
397
- properties: {
398
- fieldNames: {
399
- description: "Array of field names that together form the unique constraint.\n\nCan be single field (e.g., [\"email\"]) or composite (e.g., [\"channel_id\",\n\"code\"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: [\"code\"], [\"shopping_channel_id\",\n\"nickname\"], [\"email\"]",
400
- type: "array",
401
- items: {
402
- type: "string"
403
- },
404
- minItems: 1,
405
- uniqueItems: true
406
- },
407
- unique: {
408
- description: "Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit \"@@unique\" directive in Prisma schema instead of \"@@index\".",
409
- "const": true
410
- }
411
- },
412
- required: [
413
- "fieldNames",
414
- "unique"
415
- ]
416
- },
417
- "AutoBePrisma.IPlainIndex": {
418
- description: "Interface representing a regular (non-unique) index for query performance.\n\nRegular indexes speed up database queries by creating optimized data\nstructures for common search patterns. Essential for foreign keys, date\nranges, and frequently filtered fields.",
419
- type: "object",
420
- properties: {
421
- fieldNames: {
422
- description: "Array of field names to include in the performance index.\n\nCan be single field (e.g., [\"created_at\"]) or composite (e.g.,\n[\"customer_id\", \"created_at\"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: [\"created_at\"], [\"shopping_customer_id\",\n\"created_at\"], [\"ip\"]",
423
- type: "array",
424
- items: {
425
- type: "string"
426
- },
427
- minItems: 1,
428
- uniqueItems: true
429
- }
430
- },
431
- required: [
432
- "fieldNames"
433
- ]
434
- },
435
- "AutoBePrisma.IGinIndex": {
436
- description: "Interface representing a GIN (Generalized Inverted Index) for full-text\nsearch.\n\nGIN indexes enable advanced PostgreSQL text search capabilities including\nfuzzy matching and partial text search using trigram operations. Essential\nfor user-facing search features on text content.",
437
- type: "object",
438
- properties: {
439
- fieldName: {
440
- description: "Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: \"nickname\", \"title\", \"body\", \"name\" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.",
441
- type: "string"
442
- }
443
- },
444
- required: [
445
- "fieldName"
446
- ]
447
- }
448
- }
449
- },
450
- description: "Reviews and validates Prisma schema modifications to ensure compliance with\ndatabase design best practices and business requirements.\n\nPerforms comprehensive validation of proposed schema changes including\nnormalization compliance, relationship integrity, performance optimization,\nand business logic alignment. The review process ensures all modifications\nmaintain data consistency and follow enterprise-level database standards.",
451
- validate: (() => { const _io0 = input => "string" === typeof input.review && "string" === typeof input.plan && (Array.isArray(input.modifications) && input.modifications.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io5(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io4 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.targetModel; const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable; const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && true === input.unique; const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io8 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
452
- path: _path + ".review",
453
- expected: "string",
454
- value: input.review
455
- }), "string" === typeof input.plan || _report(_exceptionable, {
456
- path: _path + ".plan",
457
- expected: "string",
458
- value: input.plan
459
- }), (Array.isArray(input.modifications) || _report(_exceptionable, {
460
- path: _path + ".modifications",
461
- expected: "Array<AutoBePrisma.IModel>",
462
- value: input.modifications
463
- })) && input.modifications.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
464
- path: _path + ".modifications[" + _index9 + "]",
465
- expected: "AutoBePrisma.IModel",
466
- value: elem
467
- })) && _vo1(elem, _path + ".modifications[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
468
- path: _path + ".modifications[" + _index9 + "]",
469
- expected: "AutoBePrisma.IModel",
470
- value: elem
471
- })).every(flag => flag) || _report(_exceptionable, {
472
- path: _path + ".modifications",
473
- expected: "Array<AutoBePrisma.IModel>",
474
- value: input.modifications
475
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
476
- path: _path + ".name",
477
- expected: "string & SnakeCasePattern",
478
- value: input.name
479
- })) || _report(_exceptionable, {
480
- path: _path + ".name",
481
- expected: "(string & SnakeCasePattern)",
482
- value: input.name
483
- }), "string" === typeof input.description || _report(_exceptionable, {
484
- path: _path + ".description",
485
- expected: "string",
486
- value: input.description
487
- }), "boolean" === typeof input.material || _report(_exceptionable, {
488
- path: _path + ".material",
489
- expected: "boolean",
490
- value: input.material
491
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
492
- path: _path + ".stance",
493
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
494
- value: input.stance
495
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
496
- path: _path + ".primaryField",
497
- expected: "AutoBePrisma.IPrimaryField",
498
- value: input.primaryField
499
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
500
- path: _path + ".primaryField",
501
- expected: "AutoBePrisma.IPrimaryField",
502
- value: input.primaryField
503
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
504
- path: _path + ".foreignFields",
505
- expected: "Array<AutoBePrisma.IForeignField>",
506
- value: input.foreignFields
507
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
508
- path: _path + ".foreignFields[" + _index10 + "]",
509
- expected: "AutoBePrisma.IForeignField",
510
- value: elem
511
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
512
- path: _path + ".foreignFields[" + _index10 + "]",
513
- expected: "AutoBePrisma.IForeignField",
514
- value: elem
515
- })).every(flag => flag) || _report(_exceptionable, {
516
- path: _path + ".foreignFields",
517
- expected: "Array<AutoBePrisma.IForeignField>",
518
- value: input.foreignFields
519
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
520
- path: _path + ".plainFields",
521
- expected: "Array<AutoBePrisma.IPlainField>",
522
- value: input.plainFields
523
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
524
- path: _path + ".plainFields[" + _index11 + "]",
525
- expected: "AutoBePrisma.IPlainField",
526
- value: elem
527
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
528
- path: _path + ".plainFields[" + _index11 + "]",
529
- expected: "AutoBePrisma.IPlainField",
530
- value: elem
531
- })).every(flag => flag) || _report(_exceptionable, {
532
- path: _path + ".plainFields",
533
- expected: "Array<AutoBePrisma.IPlainField>",
534
- value: input.plainFields
535
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
536
- path: _path + ".uniqueIndexes",
537
- expected: "Array<AutoBePrisma.IUniqueIndex>",
538
- value: input.uniqueIndexes
539
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
540
- path: _path + ".uniqueIndexes[" + _index12 + "]",
541
- expected: "AutoBePrisma.IUniqueIndex",
542
- value: elem
543
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
544
- path: _path + ".uniqueIndexes[" + _index12 + "]",
545
- expected: "AutoBePrisma.IUniqueIndex",
546
- value: elem
547
- })).every(flag => flag) || _report(_exceptionable, {
548
- path: _path + ".uniqueIndexes",
549
- expected: "Array<AutoBePrisma.IUniqueIndex>",
550
- value: input.uniqueIndexes
551
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
552
- path: _path + ".plainIndexes",
553
- expected: "Array<AutoBePrisma.IPlainIndex>",
554
- value: input.plainIndexes
555
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
556
- path: _path + ".plainIndexes[" + _index13 + "]",
557
- expected: "AutoBePrisma.IPlainIndex",
558
- value: elem
559
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
560
- path: _path + ".plainIndexes[" + _index13 + "]",
561
- expected: "AutoBePrisma.IPlainIndex",
562
- value: elem
563
- })).every(flag => flag) || _report(_exceptionable, {
564
- path: _path + ".plainIndexes",
565
- expected: "Array<AutoBePrisma.IPlainIndex>",
566
- value: input.plainIndexes
567
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
568
- path: _path + ".ginIndexes",
569
- expected: "Array<AutoBePrisma.IGinIndex>",
570
- value: input.ginIndexes
571
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
572
- path: _path + ".ginIndexes[" + _index14 + "]",
573
- expected: "AutoBePrisma.IGinIndex",
574
- value: elem
575
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
576
- path: _path + ".ginIndexes[" + _index14 + "]",
577
- expected: "AutoBePrisma.IGinIndex",
578
- value: elem
579
- })).every(flag => flag) || _report(_exceptionable, {
580
- path: _path + ".ginIndexes",
581
- expected: "Array<AutoBePrisma.IGinIndex>",
582
- value: input.ginIndexes
583
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
584
- path: _path + ".name",
585
- expected: "string & SnakeCasePattern",
586
- value: input.name
587
- })) || _report(_exceptionable, {
588
- path: _path + ".name",
589
- expected: "(string & SnakeCasePattern)",
590
- value: input.name
591
- }), "uuid" === input.type || _report(_exceptionable, {
592
- path: _path + ".type",
593
- expected: "\"uuid\"",
594
- value: input.type
595
- }), "string" === typeof input.description || _report(_exceptionable, {
596
- path: _path + ".description",
597
- expected: "string",
598
- value: input.description
599
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
600
- path: _path + ".name",
601
- expected: "string & SnakeCasePattern",
602
- value: input.name
603
- })) || _report(_exceptionable, {
604
- path: _path + ".name",
605
- expected: "(string & SnakeCasePattern)",
606
- value: input.name
607
- }), "uuid" === input.type || _report(_exceptionable, {
608
- path: _path + ".type",
609
- expected: "\"uuid\"",
610
- value: input.type
611
- }), "string" === typeof input.description || _report(_exceptionable, {
612
- path: _path + ".description",
613
- expected: "string",
614
- value: input.description
615
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
616
- path: _path + ".relation",
617
- expected: "AutoBePrisma.IRelation",
618
- value: input.relation
619
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
620
- path: _path + ".relation",
621
- expected: "AutoBePrisma.IRelation",
622
- value: input.relation
623
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
624
- path: _path + ".unique",
625
- expected: "boolean",
626
- value: input.unique
627
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
628
- path: _path + ".nullable",
629
- expected: "boolean",
630
- value: input.nullable
631
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
632
- path: _path + ".name",
633
- expected: "string & CamelCasePattern",
634
- value: input.name
635
- })) || _report(_exceptionable, {
636
- path: _path + ".name",
637
- expected: "(string & CamelCasePattern)",
638
- value: input.name
639
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
640
- path: _path + ".targetModel",
641
- expected: "string",
642
- value: input.targetModel
643
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
644
- path: _path + ".name",
645
- expected: "string & SnakeCasePattern",
646
- value: input.name
647
- })) || _report(_exceptionable, {
648
- path: _path + ".name",
649
- expected: "(string & SnakeCasePattern)",
650
- value: input.name
651
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
652
- path: _path + ".type",
653
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
654
- value: input.type
655
- }), "string" === typeof input.description || _report(_exceptionable, {
656
- path: _path + ".description",
657
- expected: "string",
658
- value: input.description
659
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
660
- path: _path + ".nullable",
661
- expected: "boolean",
662
- value: input.nullable
663
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
664
- path: _path + ".fieldNames",
665
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
666
- value: input.fieldNames
667
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
668
- path: _path + ".fieldNames",
669
- expected: "Array<> & MinItems<1>",
670
- value: input.fieldNames
671
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
672
- path: _path + ".fieldNames",
673
- expected: "Array<> & UniqueItems<true>",
674
- value: input.fieldNames
675
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
676
- path: _path + ".fieldNames[" + _index15 + "]",
677
- expected: "string",
678
- value: elem
679
- })).every(flag => flag)) || _report(_exceptionable, {
680
- path: _path + ".fieldNames",
681
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
682
- value: input.fieldNames
683
- }), true === input.unique || _report(_exceptionable, {
684
- path: _path + ".unique",
685
- expected: "true",
686
- value: input.unique
687
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
688
- path: _path + ".fieldNames",
689
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
690
- value: input.fieldNames
691
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
692
- path: _path + ".fieldNames",
693
- expected: "Array<> & MinItems<1>",
694
- value: input.fieldNames
695
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
696
- path: _path + ".fieldNames",
697
- expected: "Array<> & UniqueItems<true>",
698
- value: input.fieldNames
699
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
700
- path: _path + ".fieldNames[" + _index16 + "]",
701
- expected: "string",
702
- value: elem
703
- })).every(flag => flag)) || _report(_exceptionable, {
704
- path: _path + ".fieldNames",
705
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
706
- value: input.fieldNames
707
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
708
- path: _path + ".fieldName",
709
- expected: "string",
710
- value: input.fieldName
711
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
712
- if (false === __is(input)) {
713
- errors = [];
714
- _report = __typia_transform__validateReport._validateReport(errors);
715
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
716
- path: _path + "",
717
- expected: "IAutoBePrismaReviewApplication.IProps",
718
- value: input
719
- })) && _vo0(input, _path + "", true) || _report(true, {
720
- path: _path + "",
721
- expected: "IAutoBePrismaReviewApplication.IProps",
722
- value: input
723
- }))(input, "$input", true);
724
- const success = 0 === errors.length;
725
- return success ? {
726
- success,
727
- data: input
728
- } : {
729
- success,
730
- errors,
731
- data: input
732
- };
733
- }
734
- return {
735
- success: true,
736
- data: input
737
- };
738
- }; })()
739
- }
740
- ]
741
- };
742
145
  const collection = {
743
146
  chatgpt: {
744
147
  model: "chatgpt",
@@ -778,7 +181,7 @@ const collection = {
778
181
  additionalProperties: false,
779
182
  $defs: {
780
183
  "AutoBePrisma.IModel": {
781
- description: "Interface representing a single Prisma model (database table).\n\nBased on the uploaded schemas, models follow specific patterns:\n\n- Main business entities (e.g., shopping_sales, shopping_customers)\n- Snapshot/versioning entities for audit trails (e.g.,\n shopping_sale_snapshots)\n- Junction tables for M:N relationships (e.g.,\n shopping_cart_commodity_stocks)\n- Materialized views for performance (prefixed with mv_)\n\n### Description of {@link primaryField} property:\n\n> The primary key field of the model.\n> \n> In all uploaded schemas, primary keys are always UUID type with \"@\\id\"\n> directive. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\n> mapping.",
184
+ description: "Interface representing a single Prisma model (database table).\n\nBased on the uploaded schemas, models follow specific patterns:\n\n- Main business entities (e.g., shopping_sales, shopping_customers)\n- Snapshot/versioning entities for audit trails (e.g.,\n shopping_sale_snapshots)\n- Junction tables for M:N relationships (e.g.,\n shopping_cart_commodity_stocks)\n- Materialized views for performance (prefixed with mv_)",
782
185
  type: "object",
783
186
  properties: {
784
187
  name: {
@@ -803,6 +206,7 @@ const collection = {
803
206
  ]
804
207
  },
805
208
  primaryField: {
209
+ description: "The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with \"@\\id\"\ndirective. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\nmapping.",
806
210
  $ref: "#/$defs/AutoBePrisma.IPrimaryField"
807
211
  },
808
212
  foreignFields: {
@@ -881,7 +285,7 @@ const collection = {
881
285
  ]
882
286
  },
883
287
  "AutoBePrisma.IForeignField": {
884
- description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.\n\n### Description of {@link relation} property:\n\n> Prisma relation configuration defining the association details.\n> \n> Specifies how this foreign key connects to the target model, including\n> relation name, target model, and target field. This configuration is used\n> to generate the appropriate Prisma relation directive in the schema.",
288
+ description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
885
289
  type: "object",
886
290
  properties: {
887
291
  name: {
@@ -900,6 +304,7 @@ const collection = {
900
304
  type: "string"
901
305
  },
902
306
  relation: {
307
+ description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
903
308
  $ref: "#/$defs/AutoBePrisma.IRelation"
904
309
  },
905
310
  unique: {
@@ -1322,9 +727,1198 @@ const collection = {
1322
727
  }
1323
728
  ]
1324
729
  },
1325
- claude,
1326
- llama: claude,
1327
- deepseek: claude,
1328
- "3.1": claude,
730
+ claude: {
731
+ model: "claude",
732
+ options: {
733
+ reference: true,
734
+ separate: null
735
+ },
736
+ functions: [
737
+ {
738
+ name: "reviewSchemaFile",
739
+ parameters: {
740
+ description: "Current Type: {@link IAutoBePrismaReviewApplication.IProps}",
741
+ type: "object",
742
+ properties: {
743
+ review: {
744
+ description: "Comprehensive review analysis of the proposed schema modifications.\n\nContains the AI agent's detailed evaluation of the schema changes,\nincluding validation of normalization compliance, relationship integrity,\nindex optimization, and business requirement alignment. The review\nidentifies potential issues and confirms adherence to best practices.\n\n**Review Dimensions:**\n\n- **Normalization Validation**: Confirms 3NF compliance and proper data\n structure\n- **Relationship Integrity**: Validates foreign key references and\n cardinality\n- **Performance Optimization**: Reviews indexing strategy and query\n patterns\n- **Business Logic Alignment**: Ensures schema supports all use cases\n- **Naming Conventions**: Verifies consistent naming patterns\n- **Data Type Consistency**: Confirms appropriate field types\n- **Temporal Field Handling**: Validates audit trail implementation\n\n**Example:**\n\n \"After reviewing the schema modifications:\n 1. All tables properly implement UUID primary keys\n 2. Foreign key relationships correctly reference existing models\n 3. Composite indexes optimize for common query patterns\n 4. Snapshot tables include proper temporal fields\n 5. Materialized views (mv_) contain appropriate denormalization\n The schema follows all best practices and is ready for implementation.\"",
745
+ type: "string"
746
+ },
747
+ plan: {
748
+ description: "Strategic database design plan that guided the schema creation.\n\nContains the original planning document that outlines the database\narchitecture strategy, including table structures, relationships,\nnormalization approach, and business requirement mapping. This plan\nserves as the blueprint for validating the implemented schema.\n\n**Planning Components:**\n\n- **Business Requirements**: Mapping of business needs to database\n structures\n- **Table Design**: Entity definitions and attribute specifications\n- **Relationship Strategy**: Cardinality and referential integrity planning\n- **Normalization Approach**: Application of 1NF, 2NF, 3NF principles\n- **Performance Considerations**: Index strategy and query optimization\n- **Snapshot Architecture**: Temporal data handling and audit requirements\n- **Materialized Views**: Denormalization strategy for performance\n\n**Example:**\n\n \"Database Design Strategy:\n Component: Sales Domain\n Tables: shopping_sales, shopping_sale_snapshots, shopping_sale_units\n\n Design Approach:\n - Normalize product catalog to 3NF for data integrity\n - Implement snapshot pattern for price history tracking\n - Create composite indexes for product search queries\n - Use materialized views for sales analytics dashboards\"",
749
+ type: "string"
750
+ },
751
+ modifications: {
752
+ description: "Array of Prisma models that have been modified based on review feedback.\n\nContains ONLY the models that required changes, not the entire schema.\nEach model represents a complete table definition with all fields,\nrelationships, indexes, and documentation. These modifications will be\napplied to the models to produce the final implementation.\n\n**Model Requirements:**\n\n- **Complete Models**: Each entry must be a complete model definition\n- **Targeted Changes**: Only includes models that need modifications\n- **AST Compliance**: Follows AutoBePrisma.IModel interface structure\n- **Relationship Integrity**: All foreign keys reference valid models\n- **Index Optimization**: Strategic indexes without redundancy\n- **Documentation**: Comprehensive English descriptions\n\n**Notes:**\n\n- Models not included in this array remain unchanged from the models\n- The final schema merges these modifications with the original models\n- All modifications must resolve issues identified in the review",
753
+ type: "array",
754
+ items: {
755
+ $ref: "#/$defs/AutoBePrisma.IModel"
756
+ }
757
+ }
758
+ },
759
+ required: [
760
+ "review",
761
+ "plan",
762
+ "modifications"
763
+ ],
764
+ additionalProperties: false,
765
+ $defs: {
766
+ "AutoBePrisma.IModel": {
767
+ description: "Interface representing a single Prisma model (database table).\n\nBased on the uploaded schemas, models follow specific patterns:\n\n- Main business entities (e.g., shopping_sales, shopping_customers)\n- Snapshot/versioning entities for audit trails (e.g.,\n shopping_sale_snapshots)\n- Junction tables for M:N relationships (e.g.,\n shopping_cart_commodity_stocks)\n- Materialized views for performance (prefixed with mv_)",
768
+ type: "object",
769
+ properties: {
770
+ name: {
771
+ description: "Name of the Prisma model (database table name).\n\nMUST use snake_case naming convention. Examples: \"shopping_customers\",\n\"shopping_sale_snapshots\", \"bbs_articles\" Materialized views use \"mv_\"\nprefix: \"mv_shopping_sale_last_snapshots\"",
772
+ type: "string",
773
+ pattern: "^[a-z][a-z0-9_]*$"
774
+ },
775
+ description: {
776
+ description: "Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using \"{@\\link ModelName}\" syntax\n\n**IMPORTANT**: Description must be written in English. Example: \"Customer\ninformation, but not a person but a **connection** basis...\"",
777
+ type: "string"
778
+ },
779
+ material: {
780
+ description: "Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They're marked as \"@\\hidden\" in documentation and prefixed with\n\"mv_\" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices",
781
+ type: "boolean"
782
+ },
783
+ stance: {
784
+ description: "Specifies the architectural stance of this model within the database\nsystem.\n\nThis property defines how the table positions itself in relation to other\ntables and what role it plays in the overall data architecture,\nparticularly for API endpoint generation and business logic\norganization.\n\n## Values:\n\n### `\"primary\"` - Main Business Entity\n\nTables that represent core business concepts and serve as the primary\nsubjects of user operations. These tables typically warrant independent\nCRUD API endpoints since users directly interact with these entities.\n\n**Key principle**: If users need to independently create, search, filter,\nor manage entities regardless of their parent context, the table should\nbe primary stance.\n\n**API Requirements:**\n\n- Independent creation endpoints (POST /articles, POST /comments)\n- Search and filtering capabilities across all instances\n- Direct update and delete operations\n- List/pagination endpoints for browsing\n\n**Why `bbs_article_comments` is primary, not subsidiary:**\n\nAlthough comments belong to articles, they require independent\nmanagement:\n\n- **Search across articles**: \"Find all comments by user X across all\n articles\"\n- **Moderation workflows**: \"List all pending comments for review\"\n- **User activity**: \"Show all comments made by this user\"\n- **Independent operations**: Users edit/delete their comments directly\n- **Notification systems**: \"Alert when any comment is posted\"\n\nIf comments were subsidiary, these operations would be impossible or\nrequire inefficient nested queries through parent articles.\n\n**Characteristics:**\n\n- Represents tangible business concepts that users manage\n- Serves as reference points for other tables\n- Requires comprehensive API operations (CREATE, READ, UPDATE, DELETE)\n- Forms the backbone of the application's business logic\n\n**Examples:**\n\n- `bbs_articles` - Forum posts that users create, edit, and manage\n- `bbs_article_comments` - User comments that require independent\n management\n\n### `\"subsidiary\"` - Supporting/Dependent Entity\n\nTables that exist to support primary entities but are not independently\nmanaged by users. These tables are typically managed through their parent\nentities and may not need standalone API endpoints.\n\n**Characteristics:**\n\n- Depends on primary or snapshot entities for context\n- Often managed indirectly through parent entity operations\n- May have limited or no independent API operations\n- Provides supporting data or relationships\n\n**Examples:**\n\n- `bbs_article_snapshot_files` - Files attached to article snapshots\n- `bbs_article_snapshot_tags` - Tags associated with article snapshots\n- `bbs_article_comment_snapshot_files` - Files attached to comment\n snapshots\n\n### `\"snapshot\"` - Historical/Versioning Entity\n\nTables that capture point-in-time states of primary entities for audit\ntrails, version control, or historical tracking. These tables record\nchanges but are rarely modified directly by users.\n\n**Characteristics:**\n\n- Captures historical states of primary entities\n- Typically append-only (rarely updated or deleted)\n- Referenced for audit trails and change tracking\n- Usually read-only from user perspective\n\n**Examples:**\n\n- `bbs_article_snapshots` - Historical states of articles\n- `bbs_article_comment_snapshots` - Comment modification history\n\n## API Generation Guidelines:\n\nThe stance property guides automatic API endpoint generation:\n\n- **`\"primary\"`** \u2192 Generate full CRUD endpoints based on business\n requirements\n- **`\"subsidiary\"`** \u2192 Evaluate carefully; often managed through parent\n entities\n- **`\"snapshot\"`** \u2192 Typically read-only endpoints for historical data\n access",
785
+ oneOf: [
786
+ {
787
+ "const": "primary"
788
+ },
789
+ {
790
+ "const": "subsidiary"
791
+ },
792
+ {
793
+ "const": "snapshot"
794
+ }
795
+ ]
796
+ },
797
+ primaryField: {
798
+ description: "The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with \"@\\id\"\ndirective. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\nmapping.",
799
+ $ref: "#/$defs/AutoBePrisma.IPrimaryField"
800
+ },
801
+ foreignFields: {
802
+ description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
803
+ type: "array",
804
+ items: {
805
+ $ref: "#/$defs/AutoBePrisma.IForeignField"
806
+ }
807
+ },
808
+ plainFields: {
809
+ description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
810
+ type: "array",
811
+ items: {
812
+ $ref: "#/$defs/AutoBePrisma.IPlainField"
813
+ }
814
+ },
815
+ uniqueIndexes: {
816
+ description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
817
+ type: "array",
818
+ items: {
819
+ $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
820
+ }
821
+ },
822
+ plainIndexes: {
823
+ description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
824
+ type: "array",
825
+ items: {
826
+ $ref: "#/$defs/AutoBePrisma.IPlainIndex"
827
+ }
828
+ },
829
+ ginIndexes: {
830
+ description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
831
+ type: "array",
832
+ items: {
833
+ $ref: "#/$defs/AutoBePrisma.IGinIndex"
834
+ }
835
+ }
836
+ },
837
+ required: [
838
+ "name",
839
+ "description",
840
+ "material",
841
+ "stance",
842
+ "primaryField",
843
+ "foreignFields",
844
+ "plainFields",
845
+ "uniqueIndexes",
846
+ "plainIndexes",
847
+ "ginIndexes"
848
+ ]
849
+ },
850
+ "AutoBePrisma.IPrimaryField": {
851
+ description: "Interface representing the primary key field of a Prisma model.\n\nAll models in the uploaded schemas use UUID as primary key for better\ndistributed system compatibility and security (no sequential ID exposure).",
852
+ type: "object",
853
+ properties: {
854
+ name: {
855
+ description: "Name of the primary key field.\n\nMUST use snake_case naming convention. Consistently named \"id\" across all\nmodels in the uploaded schemas. Represents the unique identifier for each\nrecord in the table.",
856
+ type: "string",
857
+ pattern: "^[a-z][a-z0-9_]*$"
858
+ },
859
+ type: {
860
+ description: "Data type of the primary key field.\n\nAlways \"uuid\" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.",
861
+ "const": "uuid"
862
+ },
863
+ description: {
864
+ description: "Description of the primary key field's purpose.\n\nStandard description is \"Primary Key.\" across all models. Serves as the\nunique identifier for the model instance.\n\n**IMPORTANT**: Description must be written in English.",
865
+ type: "string"
866
+ }
867
+ },
868
+ required: [
869
+ "name",
870
+ "type",
871
+ "description"
872
+ ]
873
+ },
874
+ "AutoBePrisma.IForeignField": {
875
+ description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
876
+ type: "object",
877
+ properties: {
878
+ name: {
879
+ description: "Name of the foreign key field.\n\nMUST use snake_case naming convention. Follows convention:\n\"{target_model_name_without_prefix}_id\" Examples: \"shopping_customer_id\",\n\"bbs_article_id\", \"attachment_file_id\" For self-references: \"parent_id\"\n(e.g., in hierarchical structures)",
880
+ type: "string",
881
+ pattern: "^[a-z][a-z0-9_]*$"
882
+ },
883
+ type: {
884
+ description: "Data type of the foreign key field.\n\nAlways \"uuid\" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.",
885
+ "const": "uuid"
886
+ },
887
+ description: {
888
+ description: "Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: \"Target model's {@\\link\nModelName.id}\" Examples: \"Belonged customer's {@\\link\nshopping_customers.id}\" May include additional context about the\nrelationship's business meaning.\n\n**IMPORTANT**: Description must be written in English.",
889
+ type: "string"
890
+ },
891
+ relation: {
892
+ description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
893
+ $ref: "#/$defs/AutoBePrisma.IRelation"
894
+ },
895
+ unique: {
896
+ description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
897
+ type: "boolean"
898
+ },
899
+ nullable: {
900
+ description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
901
+ type: "boolean"
902
+ }
903
+ },
904
+ required: [
905
+ "name",
906
+ "type",
907
+ "description",
908
+ "relation",
909
+ "unique",
910
+ "nullable"
911
+ ]
912
+ },
913
+ "AutoBePrisma.IRelation": {
914
+ description: "Interface representing a Prisma relation configuration between models.\n\nThis interface defines how foreign key fields establish relationships with\ntheir target models. It provides the necessary information for Prisma to\ngenerate appropriate relation directives (@relation) in the schema,\nenabling proper relational data modeling and ORM functionality.\n\nThe relation configuration is essential for:\n\n- Generating correct Prisma relation syntax\n- Establishing bidirectional relationships between models\n- Enabling proper type-safe querying through Prisma client\n- Supporting complex relationship patterns (1:1, 1:N, M:N)",
915
+ type: "object",
916
+ properties: {
917
+ name: {
918
+ description: "Name of the relation property in the Prisma model.\n\nThis becomes the property name used to access the related model instance\nthrough the Prisma client. Should be descriptive and reflect the business\nrelationship being modeled.\n\nExamples:\n\n- \"customer\" for shopping_customer_id field\n- \"channel\" for shopping_channel_id field\n- \"parent\" for parent_id field in hierarchical structures\n- \"snapshot\" for versioning relationships\n- \"article\" for bbs_article_id field\n\nNaming convention: camelCase, descriptive of the relationship's business\nmeaning",
919
+ type: "string",
920
+ pattern: "^[a-z][a-zA-Z0-9]*$"
921
+ },
922
+ targetModel: {
923
+ description: "Name of the target model being referenced by this relation.\n\nMust exactly match an existing model name in the schema. This is used by\nPrisma to establish the foreign key constraint and generate the\nappropriate relation mapping.\n\nExamples:\n\n- \"shopping_customers\" for customer relationships\n- \"shopping_channels\" for channel relationships\n- \"bbs_articles\" for article relationships\n- \"attachment_files\" for file attachments\n\nThe target model should exist in the same schema or be accessible through\nthe Prisma schema configuration.",
924
+ type: "string"
925
+ }
926
+ },
927
+ required: [
928
+ "name",
929
+ "targetModel"
930
+ ]
931
+ },
932
+ "AutoBePrisma.IPlainField": {
933
+ description: "Interface representing a regular data field that stores business\ninformation.\n\nThese fields contain the actual business data like names, amounts,\ntimestamps, flags, descriptions, and other domain-specific information.",
934
+ type: "object",
935
+ properties: {
936
+ name: {
937
+ description: "Name of the field in the database table.\n\nMUST use snake_case naming convention. Common patterns from uploaded\nschemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative",
938
+ type: "string",
939
+ pattern: "^[a-z][a-z0-9_]*$"
940
+ },
941
+ type: {
942
+ description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Datetime: Timestamp fields with date and time",
943
+ oneOf: [
944
+ {
945
+ "const": "string"
946
+ },
947
+ {
948
+ "const": "boolean"
949
+ },
950
+ {
951
+ "const": "uuid"
952
+ },
953
+ {
954
+ "const": "uri"
955
+ },
956
+ {
957
+ "const": "int"
958
+ },
959
+ {
960
+ "const": "double"
961
+ },
962
+ {
963
+ "const": "datetime"
964
+ }
965
+ ]
966
+ },
967
+ description: {
968
+ description: "Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes\n\n**IMPORTANT**: Description must be written in English. Example: \"Amount\nof cash payment.\" or \"Whether the unit is required or not.\"",
969
+ type: "string"
970
+ },
971
+ nullable: {
972
+ description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
973
+ type: "boolean"
974
+ }
975
+ },
976
+ required: [
977
+ "name",
978
+ "type",
979
+ "description",
980
+ "nullable"
981
+ ]
982
+ },
983
+ "AutoBePrisma.IUniqueIndex": {
984
+ description: "Interface representing a unique index constraint on one or more fields.\n\nUnique indexes enforce data integrity by ensuring no duplicate values exist\nfor the specified field combination. Essential for business rules that\nrequire uniqueness like email addresses, codes, or composite keys.",
985
+ type: "object",
986
+ properties: {
987
+ fieldNames: {
988
+ description: "Array of field names that together form the unique constraint.\n\nCan be single field (e.g., [\"email\"]) or composite (e.g., [\"channel_id\",\n\"code\"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: [\"code\"], [\"shopping_channel_id\",\n\"nickname\"], [\"email\"]",
989
+ type: "array",
990
+ items: {
991
+ type: "string"
992
+ },
993
+ minItems: 1,
994
+ uniqueItems: true
995
+ },
996
+ unique: {
997
+ description: "Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit \"@@unique\" directive in Prisma schema instead of \"@@index\".",
998
+ "const": true
999
+ }
1000
+ },
1001
+ required: [
1002
+ "fieldNames",
1003
+ "unique"
1004
+ ]
1005
+ },
1006
+ "AutoBePrisma.IPlainIndex": {
1007
+ description: "Interface representing a regular (non-unique) index for query performance.\n\nRegular indexes speed up database queries by creating optimized data\nstructures for common search patterns. Essential for foreign keys, date\nranges, and frequently filtered fields.",
1008
+ type: "object",
1009
+ properties: {
1010
+ fieldNames: {
1011
+ description: "Array of field names to include in the performance index.\n\nCan be single field (e.g., [\"created_at\"]) or composite (e.g.,\n[\"customer_id\", \"created_at\"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: [\"created_at\"], [\"shopping_customer_id\",\n\"created_at\"], [\"ip\"]",
1012
+ type: "array",
1013
+ items: {
1014
+ type: "string"
1015
+ },
1016
+ minItems: 1,
1017
+ uniqueItems: true
1018
+ }
1019
+ },
1020
+ required: [
1021
+ "fieldNames"
1022
+ ]
1023
+ },
1024
+ "AutoBePrisma.IGinIndex": {
1025
+ description: "Interface representing a GIN (Generalized Inverted Index) for full-text\nsearch.\n\nGIN indexes enable advanced PostgreSQL text search capabilities including\nfuzzy matching and partial text search using trigram operations. Essential\nfor user-facing search features on text content.",
1026
+ type: "object",
1027
+ properties: {
1028
+ fieldName: {
1029
+ description: "Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: \"nickname\", \"title\", \"body\", \"name\" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.",
1030
+ type: "string"
1031
+ }
1032
+ },
1033
+ required: [
1034
+ "fieldName"
1035
+ ]
1036
+ }
1037
+ }
1038
+ },
1039
+ description: "Reviews and validates Prisma schema modifications to ensure compliance with\ndatabase design best practices and business requirements.\n\nPerforms comprehensive validation of proposed schema changes including\nnormalization compliance, relationship integrity, performance optimization,\nand business logic alignment. The review process ensures all modifications\nmaintain data consistency and follow enterprise-level database standards.",
1040
+ validate: (() => { const _io0 = input => "string" === typeof input.review && "string" === typeof input.plan && (Array.isArray(input.modifications) && input.modifications.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io5(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io4 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.targetModel; const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable; const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && true === input.unique; const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io8 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
1041
+ path: _path + ".review",
1042
+ expected: "string",
1043
+ value: input.review
1044
+ }), "string" === typeof input.plan || _report(_exceptionable, {
1045
+ path: _path + ".plan",
1046
+ expected: "string",
1047
+ value: input.plan
1048
+ }), (Array.isArray(input.modifications) || _report(_exceptionable, {
1049
+ path: _path + ".modifications",
1050
+ expected: "Array<AutoBePrisma.IModel>",
1051
+ value: input.modifications
1052
+ })) && input.modifications.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1053
+ path: _path + ".modifications[" + _index9 + "]",
1054
+ expected: "AutoBePrisma.IModel",
1055
+ value: elem
1056
+ })) && _vo1(elem, _path + ".modifications[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1057
+ path: _path + ".modifications[" + _index9 + "]",
1058
+ expected: "AutoBePrisma.IModel",
1059
+ value: elem
1060
+ })).every(flag => flag) || _report(_exceptionable, {
1061
+ path: _path + ".modifications",
1062
+ expected: "Array<AutoBePrisma.IModel>",
1063
+ value: input.modifications
1064
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1065
+ path: _path + ".name",
1066
+ expected: "string & SnakeCasePattern",
1067
+ value: input.name
1068
+ })) || _report(_exceptionable, {
1069
+ path: _path + ".name",
1070
+ expected: "(string & SnakeCasePattern)",
1071
+ value: input.name
1072
+ }), "string" === typeof input.description || _report(_exceptionable, {
1073
+ path: _path + ".description",
1074
+ expected: "string",
1075
+ value: input.description
1076
+ }), "boolean" === typeof input.material || _report(_exceptionable, {
1077
+ path: _path + ".material",
1078
+ expected: "boolean",
1079
+ value: input.material
1080
+ }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
1081
+ path: _path + ".stance",
1082
+ expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
1083
+ value: input.stance
1084
+ }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
1085
+ path: _path + ".primaryField",
1086
+ expected: "AutoBePrisma.IPrimaryField",
1087
+ value: input.primaryField
1088
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1089
+ path: _path + ".primaryField",
1090
+ expected: "AutoBePrisma.IPrimaryField",
1091
+ value: input.primaryField
1092
+ }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
1093
+ path: _path + ".foreignFields",
1094
+ expected: "Array<AutoBePrisma.IForeignField>",
1095
+ value: input.foreignFields
1096
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1097
+ path: _path + ".foreignFields[" + _index10 + "]",
1098
+ expected: "AutoBePrisma.IForeignField",
1099
+ value: elem
1100
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1101
+ path: _path + ".foreignFields[" + _index10 + "]",
1102
+ expected: "AutoBePrisma.IForeignField",
1103
+ value: elem
1104
+ })).every(flag => flag) || _report(_exceptionable, {
1105
+ path: _path + ".foreignFields",
1106
+ expected: "Array<AutoBePrisma.IForeignField>",
1107
+ value: input.foreignFields
1108
+ }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
1109
+ path: _path + ".plainFields",
1110
+ expected: "Array<AutoBePrisma.IPlainField>",
1111
+ value: input.plainFields
1112
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1113
+ path: _path + ".plainFields[" + _index11 + "]",
1114
+ expected: "AutoBePrisma.IPlainField",
1115
+ value: elem
1116
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1117
+ path: _path + ".plainFields[" + _index11 + "]",
1118
+ expected: "AutoBePrisma.IPlainField",
1119
+ value: elem
1120
+ })).every(flag => flag) || _report(_exceptionable, {
1121
+ path: _path + ".plainFields",
1122
+ expected: "Array<AutoBePrisma.IPlainField>",
1123
+ value: input.plainFields
1124
+ }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
1125
+ path: _path + ".uniqueIndexes",
1126
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1127
+ value: input.uniqueIndexes
1128
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1129
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1130
+ expected: "AutoBePrisma.IUniqueIndex",
1131
+ value: elem
1132
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1133
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1134
+ expected: "AutoBePrisma.IUniqueIndex",
1135
+ value: elem
1136
+ })).every(flag => flag) || _report(_exceptionable, {
1137
+ path: _path + ".uniqueIndexes",
1138
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1139
+ value: input.uniqueIndexes
1140
+ }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
1141
+ path: _path + ".plainIndexes",
1142
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1143
+ value: input.plainIndexes
1144
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1145
+ path: _path + ".plainIndexes[" + _index13 + "]",
1146
+ expected: "AutoBePrisma.IPlainIndex",
1147
+ value: elem
1148
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1149
+ path: _path + ".plainIndexes[" + _index13 + "]",
1150
+ expected: "AutoBePrisma.IPlainIndex",
1151
+ value: elem
1152
+ })).every(flag => flag) || _report(_exceptionable, {
1153
+ path: _path + ".plainIndexes",
1154
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1155
+ value: input.plainIndexes
1156
+ }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
1157
+ path: _path + ".ginIndexes",
1158
+ expected: "Array<AutoBePrisma.IGinIndex>",
1159
+ value: input.ginIndexes
1160
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1161
+ path: _path + ".ginIndexes[" + _index14 + "]",
1162
+ expected: "AutoBePrisma.IGinIndex",
1163
+ value: elem
1164
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1165
+ path: _path + ".ginIndexes[" + _index14 + "]",
1166
+ expected: "AutoBePrisma.IGinIndex",
1167
+ value: elem
1168
+ })).every(flag => flag) || _report(_exceptionable, {
1169
+ path: _path + ".ginIndexes",
1170
+ expected: "Array<AutoBePrisma.IGinIndex>",
1171
+ value: input.ginIndexes
1172
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1173
+ path: _path + ".name",
1174
+ expected: "string & SnakeCasePattern",
1175
+ value: input.name
1176
+ })) || _report(_exceptionable, {
1177
+ path: _path + ".name",
1178
+ expected: "(string & SnakeCasePattern)",
1179
+ value: input.name
1180
+ }), "uuid" === input.type || _report(_exceptionable, {
1181
+ path: _path + ".type",
1182
+ expected: "\"uuid\"",
1183
+ value: input.type
1184
+ }), "string" === typeof input.description || _report(_exceptionable, {
1185
+ path: _path + ".description",
1186
+ expected: "string",
1187
+ value: input.description
1188
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1189
+ path: _path + ".name",
1190
+ expected: "string & SnakeCasePattern",
1191
+ value: input.name
1192
+ })) || _report(_exceptionable, {
1193
+ path: _path + ".name",
1194
+ expected: "(string & SnakeCasePattern)",
1195
+ value: input.name
1196
+ }), "uuid" === input.type || _report(_exceptionable, {
1197
+ path: _path + ".type",
1198
+ expected: "\"uuid\"",
1199
+ value: input.type
1200
+ }), "string" === typeof input.description || _report(_exceptionable, {
1201
+ path: _path + ".description",
1202
+ expected: "string",
1203
+ value: input.description
1204
+ }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
1205
+ path: _path + ".relation",
1206
+ expected: "AutoBePrisma.IRelation",
1207
+ value: input.relation
1208
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1209
+ path: _path + ".relation",
1210
+ expected: "AutoBePrisma.IRelation",
1211
+ value: input.relation
1212
+ }), "boolean" === typeof input.unique || _report(_exceptionable, {
1213
+ path: _path + ".unique",
1214
+ expected: "boolean",
1215
+ value: input.unique
1216
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1217
+ path: _path + ".nullable",
1218
+ expected: "boolean",
1219
+ value: input.nullable
1220
+ })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
1221
+ path: _path + ".name",
1222
+ expected: "string & CamelCasePattern",
1223
+ value: input.name
1224
+ })) || _report(_exceptionable, {
1225
+ path: _path + ".name",
1226
+ expected: "(string & CamelCasePattern)",
1227
+ value: input.name
1228
+ }), "string" === typeof input.targetModel || _report(_exceptionable, {
1229
+ path: _path + ".targetModel",
1230
+ expected: "string",
1231
+ value: input.targetModel
1232
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1233
+ path: _path + ".name",
1234
+ expected: "string & SnakeCasePattern",
1235
+ value: input.name
1236
+ })) || _report(_exceptionable, {
1237
+ path: _path + ".name",
1238
+ expected: "(string & SnakeCasePattern)",
1239
+ value: input.name
1240
+ }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
1241
+ path: _path + ".type",
1242
+ expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
1243
+ value: input.type
1244
+ }), "string" === typeof input.description || _report(_exceptionable, {
1245
+ path: _path + ".description",
1246
+ expected: "string",
1247
+ value: input.description
1248
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1249
+ path: _path + ".nullable",
1250
+ expected: "boolean",
1251
+ value: input.nullable
1252
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1253
+ path: _path + ".fieldNames",
1254
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1255
+ value: input.fieldNames
1256
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1257
+ path: _path + ".fieldNames",
1258
+ expected: "Array<> & MinItems<1>",
1259
+ value: input.fieldNames
1260
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1261
+ path: _path + ".fieldNames",
1262
+ expected: "Array<> & UniqueItems<true>",
1263
+ value: input.fieldNames
1264
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1265
+ path: _path + ".fieldNames[" + _index15 + "]",
1266
+ expected: "string",
1267
+ value: elem
1268
+ })).every(flag => flag)) || _report(_exceptionable, {
1269
+ path: _path + ".fieldNames",
1270
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1271
+ value: input.fieldNames
1272
+ }), true === input.unique || _report(_exceptionable, {
1273
+ path: _path + ".unique",
1274
+ expected: "true",
1275
+ value: input.unique
1276
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1277
+ path: _path + ".fieldNames",
1278
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1279
+ value: input.fieldNames
1280
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1281
+ path: _path + ".fieldNames",
1282
+ expected: "Array<> & MinItems<1>",
1283
+ value: input.fieldNames
1284
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1285
+ path: _path + ".fieldNames",
1286
+ expected: "Array<> & UniqueItems<true>",
1287
+ value: input.fieldNames
1288
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1289
+ path: _path + ".fieldNames[" + _index16 + "]",
1290
+ expected: "string",
1291
+ value: elem
1292
+ })).every(flag => flag)) || _report(_exceptionable, {
1293
+ path: _path + ".fieldNames",
1294
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1295
+ value: input.fieldNames
1296
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1297
+ path: _path + ".fieldName",
1298
+ expected: "string",
1299
+ value: input.fieldName
1300
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
1301
+ if (false === __is(input)) {
1302
+ errors = [];
1303
+ _report = __typia_transform__validateReport._validateReport(errors);
1304
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1305
+ path: _path + "",
1306
+ expected: "IAutoBePrismaReviewApplication.IProps",
1307
+ value: input
1308
+ })) && _vo0(input, _path + "", true) || _report(true, {
1309
+ path: _path + "",
1310
+ expected: "IAutoBePrismaReviewApplication.IProps",
1311
+ value: input
1312
+ }))(input, "$input", true);
1313
+ const success = 0 === errors.length;
1314
+ return success ? {
1315
+ success,
1316
+ data: input
1317
+ } : {
1318
+ success,
1319
+ errors,
1320
+ data: input
1321
+ };
1322
+ }
1323
+ return {
1324
+ success: true,
1325
+ data: input
1326
+ };
1327
+ }; })()
1328
+ }
1329
+ ]
1330
+ },
1331
+ gemini: {
1332
+ model: "gemini",
1333
+ options: {
1334
+ reference: true,
1335
+ separate: null
1336
+ },
1337
+ functions: [
1338
+ {
1339
+ name: "reviewSchemaFile",
1340
+ parameters: {
1341
+ description: "Current Type: {@link IAutoBePrismaReviewApplication.IProps}",
1342
+ type: "object",
1343
+ properties: {
1344
+ review: {
1345
+ description: "Comprehensive review analysis of the proposed schema modifications.\n\nContains the AI agent's detailed evaluation of the schema changes,\nincluding validation of normalization compliance, relationship integrity,\nindex optimization, and business requirement alignment. The review\nidentifies potential issues and confirms adherence to best practices.\n\n**Review Dimensions:**\n\n- **Normalization Validation**: Confirms 3NF compliance and proper data\n structure\n- **Relationship Integrity**: Validates foreign key references and\n cardinality\n- **Performance Optimization**: Reviews indexing strategy and query\n patterns\n- **Business Logic Alignment**: Ensures schema supports all use cases\n- **Naming Conventions**: Verifies consistent naming patterns\n- **Data Type Consistency**: Confirms appropriate field types\n- **Temporal Field Handling**: Validates audit trail implementation\n\n**Example:**\n\n \"After reviewing the schema modifications:\n 1. All tables properly implement UUID primary keys\n 2. Foreign key relationships correctly reference existing models\n 3. Composite indexes optimize for common query patterns\n 4. Snapshot tables include proper temporal fields\n 5. Materialized views (mv_) contain appropriate denormalization\n The schema follows all best practices and is ready for implementation.\"",
1346
+ type: "string"
1347
+ },
1348
+ plan: {
1349
+ description: "Strategic database design plan that guided the schema creation.\n\nContains the original planning document that outlines the database\narchitecture strategy, including table structures, relationships,\nnormalization approach, and business requirement mapping. This plan\nserves as the blueprint for validating the implemented schema.\n\n**Planning Components:**\n\n- **Business Requirements**: Mapping of business needs to database\n structures\n- **Table Design**: Entity definitions and attribute specifications\n- **Relationship Strategy**: Cardinality and referential integrity planning\n- **Normalization Approach**: Application of 1NF, 2NF, 3NF principles\n- **Performance Considerations**: Index strategy and query optimization\n- **Snapshot Architecture**: Temporal data handling and audit requirements\n- **Materialized Views**: Denormalization strategy for performance\n\n**Example:**\n\n \"Database Design Strategy:\n Component: Sales Domain\n Tables: shopping_sales, shopping_sale_snapshots, shopping_sale_units\n\n Design Approach:\n - Normalize product catalog to 3NF for data integrity\n - Implement snapshot pattern for price history tracking\n - Create composite indexes for product search queries\n - Use materialized views for sales analytics dashboards\"",
1350
+ type: "string"
1351
+ },
1352
+ modifications: {
1353
+ description: "Array of Prisma models that have been modified based on review feedback.\n\nContains ONLY the models that required changes, not the entire schema.\nEach model represents a complete table definition with all fields,\nrelationships, indexes, and documentation. These modifications will be\napplied to the models to produce the final implementation.\n\n**Model Requirements:**\n\n- **Complete Models**: Each entry must be a complete model definition\n- **Targeted Changes**: Only includes models that need modifications\n- **AST Compliance**: Follows AutoBePrisma.IModel interface structure\n- **Relationship Integrity**: All foreign keys reference valid models\n- **Index Optimization**: Strategic indexes without redundancy\n- **Documentation**: Comprehensive English descriptions\n\n**Notes:**\n\n- Models not included in this array remain unchanged from the models\n- The final schema merges these modifications with the original models\n- All modifications must resolve issues identified in the review",
1354
+ type: "array",
1355
+ items: {
1356
+ $ref: "#/$defs/AutoBePrisma.IModel"
1357
+ }
1358
+ }
1359
+ },
1360
+ required: [
1361
+ "review",
1362
+ "plan",
1363
+ "modifications"
1364
+ ],
1365
+ additionalProperties: false,
1366
+ $defs: {
1367
+ "AutoBePrisma.IModel": {
1368
+ description: "Interface representing a single Prisma model (database table).\n\nBased on the uploaded schemas, models follow specific patterns:\n\n- Main business entities (e.g., shopping_sales, shopping_customers)\n- Snapshot/versioning entities for audit trails (e.g.,\n shopping_sale_snapshots)\n- Junction tables for M:N relationships (e.g.,\n shopping_cart_commodity_stocks)\n- Materialized views for performance (prefixed with mv_)",
1369
+ type: "object",
1370
+ properties: {
1371
+ name: {
1372
+ description: "Name of the Prisma model (database table name).\n\nMUST use snake_case naming convention. Examples: \"shopping_customers\",\n\"shopping_sale_snapshots\", \"bbs_articles\" Materialized views use \"mv_\"\nprefix: \"mv_shopping_sale_last_snapshots\"",
1373
+ type: "string",
1374
+ pattern: "^[a-z][a-z0-9_]*$"
1375
+ },
1376
+ description: {
1377
+ description: "Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using \"{@\\link ModelName}\" syntax\n\n**IMPORTANT**: Description must be written in English. Example: \"Customer\ninformation, but not a person but a **connection** basis...\"",
1378
+ type: "string"
1379
+ },
1380
+ material: {
1381
+ description: "Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They're marked as \"@\\hidden\" in documentation and prefixed with\n\"mv_\" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices",
1382
+ type: "boolean"
1383
+ },
1384
+ stance: {
1385
+ description: "Specifies the architectural stance of this model within the database\nsystem.\n\nThis property defines how the table positions itself in relation to other\ntables and what role it plays in the overall data architecture,\nparticularly for API endpoint generation and business logic\norganization.\n\n## Values:\n\n### `\"primary\"` - Main Business Entity\n\nTables that represent core business concepts and serve as the primary\nsubjects of user operations. These tables typically warrant independent\nCRUD API endpoints since users directly interact with these entities.\n\n**Key principle**: If users need to independently create, search, filter,\nor manage entities regardless of their parent context, the table should\nbe primary stance.\n\n**API Requirements:**\n\n- Independent creation endpoints (POST /articles, POST /comments)\n- Search and filtering capabilities across all instances\n- Direct update and delete operations\n- List/pagination endpoints for browsing\n\n**Why `bbs_article_comments` is primary, not subsidiary:**\n\nAlthough comments belong to articles, they require independent\nmanagement:\n\n- **Search across articles**: \"Find all comments by user X across all\n articles\"\n- **Moderation workflows**: \"List all pending comments for review\"\n- **User activity**: \"Show all comments made by this user\"\n- **Independent operations**: Users edit/delete their comments directly\n- **Notification systems**: \"Alert when any comment is posted\"\n\nIf comments were subsidiary, these operations would be impossible or\nrequire inefficient nested queries through parent articles.\n\n**Characteristics:**\n\n- Represents tangible business concepts that users manage\n- Serves as reference points for other tables\n- Requires comprehensive API operations (CREATE, READ, UPDATE, DELETE)\n- Forms the backbone of the application's business logic\n\n**Examples:**\n\n- `bbs_articles` - Forum posts that users create, edit, and manage\n- `bbs_article_comments` - User comments that require independent\n management\n\n### `\"subsidiary\"` - Supporting/Dependent Entity\n\nTables that exist to support primary entities but are not independently\nmanaged by users. These tables are typically managed through their parent\nentities and may not need standalone API endpoints.\n\n**Characteristics:**\n\n- Depends on primary or snapshot entities for context\n- Often managed indirectly through parent entity operations\n- May have limited or no independent API operations\n- Provides supporting data or relationships\n\n**Examples:**\n\n- `bbs_article_snapshot_files` - Files attached to article snapshots\n- `bbs_article_snapshot_tags` - Tags associated with article snapshots\n- `bbs_article_comment_snapshot_files` - Files attached to comment\n snapshots\n\n### `\"snapshot\"` - Historical/Versioning Entity\n\nTables that capture point-in-time states of primary entities for audit\ntrails, version control, or historical tracking. These tables record\nchanges but are rarely modified directly by users.\n\n**Characteristics:**\n\n- Captures historical states of primary entities\n- Typically append-only (rarely updated or deleted)\n- Referenced for audit trails and change tracking\n- Usually read-only from user perspective\n\n**Examples:**\n\n- `bbs_article_snapshots` - Historical states of articles\n- `bbs_article_comment_snapshots` - Comment modification history\n\n## API Generation Guidelines:\n\nThe stance property guides automatic API endpoint generation:\n\n- **`\"primary\"`** \u2192 Generate full CRUD endpoints based on business\n requirements\n- **`\"subsidiary\"`** \u2192 Evaluate carefully; often managed through parent\n entities\n- **`\"snapshot\"`** \u2192 Typically read-only endpoints for historical data\n access",
1386
+ type: "string",
1387
+ "enum": [
1388
+ "primary",
1389
+ "subsidiary",
1390
+ "snapshot"
1391
+ ]
1392
+ },
1393
+ primaryField: {
1394
+ description: "The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with \"@\\id\"\ndirective. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\nmapping.",
1395
+ $ref: "#/$defs/AutoBePrisma.IPrimaryField"
1396
+ },
1397
+ foreignFields: {
1398
+ description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
1399
+ type: "array",
1400
+ items: {
1401
+ $ref: "#/$defs/AutoBePrisma.IForeignField"
1402
+ }
1403
+ },
1404
+ plainFields: {
1405
+ description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
1406
+ type: "array",
1407
+ items: {
1408
+ $ref: "#/$defs/AutoBePrisma.IPlainField"
1409
+ }
1410
+ },
1411
+ uniqueIndexes: {
1412
+ description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
1413
+ type: "array",
1414
+ items: {
1415
+ $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
1416
+ }
1417
+ },
1418
+ plainIndexes: {
1419
+ description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
1420
+ type: "array",
1421
+ items: {
1422
+ $ref: "#/$defs/AutoBePrisma.IPlainIndex"
1423
+ }
1424
+ },
1425
+ ginIndexes: {
1426
+ description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
1427
+ type: "array",
1428
+ items: {
1429
+ $ref: "#/$defs/AutoBePrisma.IGinIndex"
1430
+ }
1431
+ }
1432
+ },
1433
+ required: [
1434
+ "name",
1435
+ "description",
1436
+ "material",
1437
+ "stance",
1438
+ "primaryField",
1439
+ "foreignFields",
1440
+ "plainFields",
1441
+ "uniqueIndexes",
1442
+ "plainIndexes",
1443
+ "ginIndexes"
1444
+ ]
1445
+ },
1446
+ "AutoBePrisma.IPrimaryField": {
1447
+ description: "Interface representing the primary key field of a Prisma model.\n\nAll models in the uploaded schemas use UUID as primary key for better\ndistributed system compatibility and security (no sequential ID exposure).",
1448
+ type: "object",
1449
+ properties: {
1450
+ name: {
1451
+ description: "Name of the primary key field.\n\nMUST use snake_case naming convention. Consistently named \"id\" across all\nmodels in the uploaded schemas. Represents the unique identifier for each\nrecord in the table.",
1452
+ type: "string",
1453
+ pattern: "^[a-z][a-z0-9_]*$"
1454
+ },
1455
+ type: {
1456
+ description: "Data type of the primary key field.\n\nAlways \"uuid\" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.",
1457
+ type: "string",
1458
+ "enum": [
1459
+ "uuid"
1460
+ ]
1461
+ },
1462
+ description: {
1463
+ description: "Description of the primary key field's purpose.\n\nStandard description is \"Primary Key.\" across all models. Serves as the\nunique identifier for the model instance.\n\n**IMPORTANT**: Description must be written in English.",
1464
+ type: "string"
1465
+ }
1466
+ },
1467
+ required: [
1468
+ "name",
1469
+ "type",
1470
+ "description"
1471
+ ]
1472
+ },
1473
+ "AutoBePrisma.IForeignField": {
1474
+ description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
1475
+ type: "object",
1476
+ properties: {
1477
+ name: {
1478
+ description: "Name of the foreign key field.\n\nMUST use snake_case naming convention. Follows convention:\n\"{target_model_name_without_prefix}_id\" Examples: \"shopping_customer_id\",\n\"bbs_article_id\", \"attachment_file_id\" For self-references: \"parent_id\"\n(e.g., in hierarchical structures)",
1479
+ type: "string",
1480
+ pattern: "^[a-z][a-z0-9_]*$"
1481
+ },
1482
+ type: {
1483
+ description: "Data type of the foreign key field.\n\nAlways \"uuid\" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.",
1484
+ type: "string",
1485
+ "enum": [
1486
+ "uuid"
1487
+ ]
1488
+ },
1489
+ description: {
1490
+ description: "Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: \"Target model's {@\\link\nModelName.id}\" Examples: \"Belonged customer's {@\\link\nshopping_customers.id}\" May include additional context about the\nrelationship's business meaning.\n\n**IMPORTANT**: Description must be written in English.",
1491
+ type: "string"
1492
+ },
1493
+ relation: {
1494
+ description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
1495
+ $ref: "#/$defs/AutoBePrisma.IRelation"
1496
+ },
1497
+ unique: {
1498
+ description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
1499
+ type: "boolean"
1500
+ },
1501
+ nullable: {
1502
+ description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
1503
+ type: "boolean"
1504
+ }
1505
+ },
1506
+ required: [
1507
+ "name",
1508
+ "type",
1509
+ "description",
1510
+ "relation",
1511
+ "unique",
1512
+ "nullable"
1513
+ ]
1514
+ },
1515
+ "AutoBePrisma.IRelation": {
1516
+ description: "Interface representing a Prisma relation configuration between models.\n\nThis interface defines how foreign key fields establish relationships with\ntheir target models. It provides the necessary information for Prisma to\ngenerate appropriate relation directives (@relation) in the schema,\nenabling proper relational data modeling and ORM functionality.\n\nThe relation configuration is essential for:\n\n- Generating correct Prisma relation syntax\n- Establishing bidirectional relationships between models\n- Enabling proper type-safe querying through Prisma client\n- Supporting complex relationship patterns (1:1, 1:N, M:N)",
1517
+ type: "object",
1518
+ properties: {
1519
+ name: {
1520
+ description: "Name of the relation property in the Prisma model.\n\nThis becomes the property name used to access the related model instance\nthrough the Prisma client. Should be descriptive and reflect the business\nrelationship being modeled.\n\nExamples:\n\n- \"customer\" for shopping_customer_id field\n- \"channel\" for shopping_channel_id field\n- \"parent\" for parent_id field in hierarchical structures\n- \"snapshot\" for versioning relationships\n- \"article\" for bbs_article_id field\n\nNaming convention: camelCase, descriptive of the relationship's business\nmeaning",
1521
+ type: "string",
1522
+ pattern: "^[a-z][a-zA-Z0-9]*$"
1523
+ },
1524
+ targetModel: {
1525
+ description: "Name of the target model being referenced by this relation.\n\nMust exactly match an existing model name in the schema. This is used by\nPrisma to establish the foreign key constraint and generate the\nappropriate relation mapping.\n\nExamples:\n\n- \"shopping_customers\" for customer relationships\n- \"shopping_channels\" for channel relationships\n- \"bbs_articles\" for article relationships\n- \"attachment_files\" for file attachments\n\nThe target model should exist in the same schema or be accessible through\nthe Prisma schema configuration.",
1526
+ type: "string"
1527
+ }
1528
+ },
1529
+ required: [
1530
+ "name",
1531
+ "targetModel"
1532
+ ]
1533
+ },
1534
+ "AutoBePrisma.IPlainField": {
1535
+ description: "Interface representing a regular data field that stores business\ninformation.\n\nThese fields contain the actual business data like names, amounts,\ntimestamps, flags, descriptions, and other domain-specific information.",
1536
+ type: "object",
1537
+ properties: {
1538
+ name: {
1539
+ description: "Name of the field in the database table.\n\nMUST use snake_case naming convention. Common patterns from uploaded\nschemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative",
1540
+ type: "string",
1541
+ pattern: "^[a-z][a-z0-9_]*$"
1542
+ },
1543
+ type: {
1544
+ description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Datetime: Timestamp fields with date and time",
1545
+ type: "string",
1546
+ "enum": [
1547
+ "string",
1548
+ "boolean",
1549
+ "uuid",
1550
+ "uri",
1551
+ "int",
1552
+ "double",
1553
+ "datetime"
1554
+ ]
1555
+ },
1556
+ description: {
1557
+ description: "Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes\n\n**IMPORTANT**: Description must be written in English. Example: \"Amount\nof cash payment.\" or \"Whether the unit is required or not.\"",
1558
+ type: "string"
1559
+ },
1560
+ nullable: {
1561
+ description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
1562
+ type: "boolean"
1563
+ }
1564
+ },
1565
+ required: [
1566
+ "name",
1567
+ "type",
1568
+ "description",
1569
+ "nullable"
1570
+ ]
1571
+ },
1572
+ "AutoBePrisma.IUniqueIndex": {
1573
+ description: "Interface representing a unique index constraint on one or more fields.\n\nUnique indexes enforce data integrity by ensuring no duplicate values exist\nfor the specified field combination. Essential for business rules that\nrequire uniqueness like email addresses, codes, or composite keys.",
1574
+ type: "object",
1575
+ properties: {
1576
+ fieldNames: {
1577
+ description: "Array of field names that together form the unique constraint.\n\nCan be single field (e.g., [\"email\"]) or composite (e.g., [\"channel_id\",\n\"code\"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: [\"code\"], [\"shopping_channel_id\",\n\"nickname\"], [\"email\"]",
1578
+ type: "array",
1579
+ items: {
1580
+ type: "string"
1581
+ },
1582
+ minItems: 1,
1583
+ uniqueItems: true
1584
+ },
1585
+ unique: {
1586
+ description: "Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit \"@@unique\" directive in Prisma schema instead of \"@@index\".",
1587
+ type: "boolean",
1588
+ "enum": [
1589
+ true
1590
+ ]
1591
+ }
1592
+ },
1593
+ required: [
1594
+ "fieldNames",
1595
+ "unique"
1596
+ ]
1597
+ },
1598
+ "AutoBePrisma.IPlainIndex": {
1599
+ description: "Interface representing a regular (non-unique) index for query performance.\n\nRegular indexes speed up database queries by creating optimized data\nstructures for common search patterns. Essential for foreign keys, date\nranges, and frequently filtered fields.",
1600
+ type: "object",
1601
+ properties: {
1602
+ fieldNames: {
1603
+ description: "Array of field names to include in the performance index.\n\nCan be single field (e.g., [\"created_at\"]) or composite (e.g.,\n[\"customer_id\", \"created_at\"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: [\"created_at\"], [\"shopping_customer_id\",\n\"created_at\"], [\"ip\"]",
1604
+ type: "array",
1605
+ items: {
1606
+ type: "string"
1607
+ },
1608
+ minItems: 1,
1609
+ uniqueItems: true
1610
+ }
1611
+ },
1612
+ required: [
1613
+ "fieldNames"
1614
+ ]
1615
+ },
1616
+ "AutoBePrisma.IGinIndex": {
1617
+ description: "Interface representing a GIN (Generalized Inverted Index) for full-text\nsearch.\n\nGIN indexes enable advanced PostgreSQL text search capabilities including\nfuzzy matching and partial text search using trigram operations. Essential\nfor user-facing search features on text content.",
1618
+ type: "object",
1619
+ properties: {
1620
+ fieldName: {
1621
+ description: "Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: \"nickname\", \"title\", \"body\", \"name\" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.",
1622
+ type: "string"
1623
+ }
1624
+ },
1625
+ required: [
1626
+ "fieldName"
1627
+ ]
1628
+ }
1629
+ }
1630
+ },
1631
+ description: "Reviews and validates Prisma schema modifications to ensure compliance with\ndatabase design best practices and business requirements.\n\nPerforms comprehensive validation of proposed schema changes including\nnormalization compliance, relationship integrity, performance optimization,\nand business logic alignment. The review process ensures all modifications\nmaintain data consistency and follow enterprise-level database standards.",
1632
+ validate: (() => { const _io0 = input => "string" === typeof input.review && "string" === typeof input.plan && (Array.isArray(input.modifications) && input.modifications.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io5(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io4 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.targetModel; const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable; const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && true === input.unique; const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io8 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
1633
+ path: _path + ".review",
1634
+ expected: "string",
1635
+ value: input.review
1636
+ }), "string" === typeof input.plan || _report(_exceptionable, {
1637
+ path: _path + ".plan",
1638
+ expected: "string",
1639
+ value: input.plan
1640
+ }), (Array.isArray(input.modifications) || _report(_exceptionable, {
1641
+ path: _path + ".modifications",
1642
+ expected: "Array<AutoBePrisma.IModel>",
1643
+ value: input.modifications
1644
+ })) && input.modifications.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1645
+ path: _path + ".modifications[" + _index9 + "]",
1646
+ expected: "AutoBePrisma.IModel",
1647
+ value: elem
1648
+ })) && _vo1(elem, _path + ".modifications[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1649
+ path: _path + ".modifications[" + _index9 + "]",
1650
+ expected: "AutoBePrisma.IModel",
1651
+ value: elem
1652
+ })).every(flag => flag) || _report(_exceptionable, {
1653
+ path: _path + ".modifications",
1654
+ expected: "Array<AutoBePrisma.IModel>",
1655
+ value: input.modifications
1656
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1657
+ path: _path + ".name",
1658
+ expected: "string & SnakeCasePattern",
1659
+ value: input.name
1660
+ })) || _report(_exceptionable, {
1661
+ path: _path + ".name",
1662
+ expected: "(string & SnakeCasePattern)",
1663
+ value: input.name
1664
+ }), "string" === typeof input.description || _report(_exceptionable, {
1665
+ path: _path + ".description",
1666
+ expected: "string",
1667
+ value: input.description
1668
+ }), "boolean" === typeof input.material || _report(_exceptionable, {
1669
+ path: _path + ".material",
1670
+ expected: "boolean",
1671
+ value: input.material
1672
+ }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
1673
+ path: _path + ".stance",
1674
+ expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
1675
+ value: input.stance
1676
+ }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
1677
+ path: _path + ".primaryField",
1678
+ expected: "AutoBePrisma.IPrimaryField",
1679
+ value: input.primaryField
1680
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1681
+ path: _path + ".primaryField",
1682
+ expected: "AutoBePrisma.IPrimaryField",
1683
+ value: input.primaryField
1684
+ }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
1685
+ path: _path + ".foreignFields",
1686
+ expected: "Array<AutoBePrisma.IForeignField>",
1687
+ value: input.foreignFields
1688
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1689
+ path: _path + ".foreignFields[" + _index10 + "]",
1690
+ expected: "AutoBePrisma.IForeignField",
1691
+ value: elem
1692
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1693
+ path: _path + ".foreignFields[" + _index10 + "]",
1694
+ expected: "AutoBePrisma.IForeignField",
1695
+ value: elem
1696
+ })).every(flag => flag) || _report(_exceptionable, {
1697
+ path: _path + ".foreignFields",
1698
+ expected: "Array<AutoBePrisma.IForeignField>",
1699
+ value: input.foreignFields
1700
+ }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
1701
+ path: _path + ".plainFields",
1702
+ expected: "Array<AutoBePrisma.IPlainField>",
1703
+ value: input.plainFields
1704
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1705
+ path: _path + ".plainFields[" + _index11 + "]",
1706
+ expected: "AutoBePrisma.IPlainField",
1707
+ value: elem
1708
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1709
+ path: _path + ".plainFields[" + _index11 + "]",
1710
+ expected: "AutoBePrisma.IPlainField",
1711
+ value: elem
1712
+ })).every(flag => flag) || _report(_exceptionable, {
1713
+ path: _path + ".plainFields",
1714
+ expected: "Array<AutoBePrisma.IPlainField>",
1715
+ value: input.plainFields
1716
+ }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
1717
+ path: _path + ".uniqueIndexes",
1718
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1719
+ value: input.uniqueIndexes
1720
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1721
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1722
+ expected: "AutoBePrisma.IUniqueIndex",
1723
+ value: elem
1724
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1725
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1726
+ expected: "AutoBePrisma.IUniqueIndex",
1727
+ value: elem
1728
+ })).every(flag => flag) || _report(_exceptionable, {
1729
+ path: _path + ".uniqueIndexes",
1730
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1731
+ value: input.uniqueIndexes
1732
+ }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
1733
+ path: _path + ".plainIndexes",
1734
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1735
+ value: input.plainIndexes
1736
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1737
+ path: _path + ".plainIndexes[" + _index13 + "]",
1738
+ expected: "AutoBePrisma.IPlainIndex",
1739
+ value: elem
1740
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1741
+ path: _path + ".plainIndexes[" + _index13 + "]",
1742
+ expected: "AutoBePrisma.IPlainIndex",
1743
+ value: elem
1744
+ })).every(flag => flag) || _report(_exceptionable, {
1745
+ path: _path + ".plainIndexes",
1746
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1747
+ value: input.plainIndexes
1748
+ }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
1749
+ path: _path + ".ginIndexes",
1750
+ expected: "Array<AutoBePrisma.IGinIndex>",
1751
+ value: input.ginIndexes
1752
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1753
+ path: _path + ".ginIndexes[" + _index14 + "]",
1754
+ expected: "AutoBePrisma.IGinIndex",
1755
+ value: elem
1756
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1757
+ path: _path + ".ginIndexes[" + _index14 + "]",
1758
+ expected: "AutoBePrisma.IGinIndex",
1759
+ value: elem
1760
+ })).every(flag => flag) || _report(_exceptionable, {
1761
+ path: _path + ".ginIndexes",
1762
+ expected: "Array<AutoBePrisma.IGinIndex>",
1763
+ value: input.ginIndexes
1764
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1765
+ path: _path + ".name",
1766
+ expected: "string & SnakeCasePattern",
1767
+ value: input.name
1768
+ })) || _report(_exceptionable, {
1769
+ path: _path + ".name",
1770
+ expected: "(string & SnakeCasePattern)",
1771
+ value: input.name
1772
+ }), "uuid" === input.type || _report(_exceptionable, {
1773
+ path: _path + ".type",
1774
+ expected: "\"uuid\"",
1775
+ value: input.type
1776
+ }), "string" === typeof input.description || _report(_exceptionable, {
1777
+ path: _path + ".description",
1778
+ expected: "string",
1779
+ value: input.description
1780
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1781
+ path: _path + ".name",
1782
+ expected: "string & SnakeCasePattern",
1783
+ value: input.name
1784
+ })) || _report(_exceptionable, {
1785
+ path: _path + ".name",
1786
+ expected: "(string & SnakeCasePattern)",
1787
+ value: input.name
1788
+ }), "uuid" === input.type || _report(_exceptionable, {
1789
+ path: _path + ".type",
1790
+ expected: "\"uuid\"",
1791
+ value: input.type
1792
+ }), "string" === typeof input.description || _report(_exceptionable, {
1793
+ path: _path + ".description",
1794
+ expected: "string",
1795
+ value: input.description
1796
+ }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
1797
+ path: _path + ".relation",
1798
+ expected: "AutoBePrisma.IRelation",
1799
+ value: input.relation
1800
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1801
+ path: _path + ".relation",
1802
+ expected: "AutoBePrisma.IRelation",
1803
+ value: input.relation
1804
+ }), "boolean" === typeof input.unique || _report(_exceptionable, {
1805
+ path: _path + ".unique",
1806
+ expected: "boolean",
1807
+ value: input.unique
1808
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1809
+ path: _path + ".nullable",
1810
+ expected: "boolean",
1811
+ value: input.nullable
1812
+ })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
1813
+ path: _path + ".name",
1814
+ expected: "string & CamelCasePattern",
1815
+ value: input.name
1816
+ })) || _report(_exceptionable, {
1817
+ path: _path + ".name",
1818
+ expected: "(string & CamelCasePattern)",
1819
+ value: input.name
1820
+ }), "string" === typeof input.targetModel || _report(_exceptionable, {
1821
+ path: _path + ".targetModel",
1822
+ expected: "string",
1823
+ value: input.targetModel
1824
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1825
+ path: _path + ".name",
1826
+ expected: "string & SnakeCasePattern",
1827
+ value: input.name
1828
+ })) || _report(_exceptionable, {
1829
+ path: _path + ".name",
1830
+ expected: "(string & SnakeCasePattern)",
1831
+ value: input.name
1832
+ }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
1833
+ path: _path + ".type",
1834
+ expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
1835
+ value: input.type
1836
+ }), "string" === typeof input.description || _report(_exceptionable, {
1837
+ path: _path + ".description",
1838
+ expected: "string",
1839
+ value: input.description
1840
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1841
+ path: _path + ".nullable",
1842
+ expected: "boolean",
1843
+ value: input.nullable
1844
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1845
+ path: _path + ".fieldNames",
1846
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1847
+ value: input.fieldNames
1848
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1849
+ path: _path + ".fieldNames",
1850
+ expected: "Array<> & MinItems<1>",
1851
+ value: input.fieldNames
1852
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1853
+ path: _path + ".fieldNames",
1854
+ expected: "Array<> & UniqueItems<true>",
1855
+ value: input.fieldNames
1856
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1857
+ path: _path + ".fieldNames[" + _index15 + "]",
1858
+ expected: "string",
1859
+ value: elem
1860
+ })).every(flag => flag)) || _report(_exceptionable, {
1861
+ path: _path + ".fieldNames",
1862
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1863
+ value: input.fieldNames
1864
+ }), true === input.unique || _report(_exceptionable, {
1865
+ path: _path + ".unique",
1866
+ expected: "true",
1867
+ value: input.unique
1868
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1869
+ path: _path + ".fieldNames",
1870
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1871
+ value: input.fieldNames
1872
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1873
+ path: _path + ".fieldNames",
1874
+ expected: "Array<> & MinItems<1>",
1875
+ value: input.fieldNames
1876
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1877
+ path: _path + ".fieldNames",
1878
+ expected: "Array<> & UniqueItems<true>",
1879
+ value: input.fieldNames
1880
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1881
+ path: _path + ".fieldNames[" + _index16 + "]",
1882
+ expected: "string",
1883
+ value: elem
1884
+ })).every(flag => flag)) || _report(_exceptionable, {
1885
+ path: _path + ".fieldNames",
1886
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1887
+ value: input.fieldNames
1888
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1889
+ path: _path + ".fieldName",
1890
+ expected: "string",
1891
+ value: input.fieldName
1892
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
1893
+ if (false === __is(input)) {
1894
+ errors = [];
1895
+ _report = __typia_transform__validateReport._validateReport(errors);
1896
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1897
+ path: _path + "",
1898
+ expected: "IAutoBePrismaReviewApplication.IProps",
1899
+ value: input
1900
+ })) && _vo0(input, _path + "", true) || _report(true, {
1901
+ path: _path + "",
1902
+ expected: "IAutoBePrismaReviewApplication.IProps",
1903
+ value: input
1904
+ }))(input, "$input", true);
1905
+ const success = 0 === errors.length;
1906
+ return success ? {
1907
+ success,
1908
+ data: input
1909
+ } : {
1910
+ success,
1911
+ errors,
1912
+ data: input
1913
+ };
1914
+ }
1915
+ return {
1916
+ success: true,
1917
+ data: input
1918
+ };
1919
+ }; })()
1920
+ }
1921
+ ]
1922
+ },
1329
1923
  };
1330
1924
  //# sourceMappingURL=orchestratePrismaReview.js.map