@autobe/agent 0.26.0 → 0.28.0

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 (205) hide show
  1. package/lib/AutoBeAgent.d.ts +2 -1
  2. package/lib/AutoBeAgent.js +27 -7
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/AutoBeMockAgent.js +2 -4
  5. package/lib/AutoBeMockAgent.js.map +1 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -11
  7. package/lib/context/AutoBeContext.d.ts +4 -1
  8. package/lib/context/AutoBeTokenUsage.d.ts +1 -1
  9. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  10. package/lib/context/assertSchemaModel.d.ts +1 -1
  11. package/lib/context/assertSchemaModel.js +4 -7
  12. package/lib/context/assertSchemaModel.js.map +1 -1
  13. package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
  14. package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
  15. package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
  16. package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
  17. package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
  18. package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
  19. package/lib/factory/createAutoBeContext.d.ts +2 -1
  20. package/lib/factory/createAutoBeContext.js +78 -27
  21. package/lib/factory/createAutoBeContext.js.map +1 -1
  22. package/lib/index.mjs +24065 -12997
  23. package/lib/index.mjs.map +1 -1
  24. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
  25. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyze.js +1 -0
  27. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +166 -87
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  30. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +639 -322
  31. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  32. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +146 -76
  33. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  34. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +17 -52
  35. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +25 -22
  36. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +7 -23
  37. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
  38. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +168 -4
  39. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  40. package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
  41. package/lib/orchestrate/facade/createAutoBeFacadeController.js +1308 -0
  42. package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
  43. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
  44. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
  45. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
  46. package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
  47. package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
  48. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +2 -2
  49. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  50. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  52. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
  53. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  54. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +1 -1
  55. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  56. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  57. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  58. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  59. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  60. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  61. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  62. package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
  63. package/lib/orchestrate/interface/orchestrateInterface.js +15 -8
  64. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  65. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +874 -49
  66. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  67. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1858 -67
  68. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  69. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +251 -133
  70. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  71. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
  72. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +257 -135
  73. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
  74. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +341 -227
  75. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  76. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +761 -49
  77. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  78. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +911 -50
  79. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  80. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +207 -4
  81. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
  82. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +109 -2
  83. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  84. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +5 -3
  85. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1904 -77
  86. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  87. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1858 -67
  88. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  89. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +23 -23
  90. package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
  91. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
  92. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  93. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +391 -197
  94. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  95. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1168 -591
  96. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  97. package/lib/orchestrate/prisma/orchestratePrismaReview.js +1186 -600
  98. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  99. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +6 -3
  100. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  101. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +2 -2
  102. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  103. package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
  104. package/lib/orchestrate/realize/orchestrateRealize.js +2 -1
  105. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  106. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +362 -180
  107. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  108. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +399 -199
  109. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  110. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +133 -4
  111. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  112. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +171 -7
  113. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  114. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +132 -3
  115. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  116. package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
  117. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  118. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  119. package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
  120. package/lib/orchestrate/test/orchestrateTest.js +2 -1
  121. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  122. package/lib/orchestrate/test/orchestrateTestCorrect.js +134 -3
  123. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  124. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +169 -4
  125. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  126. package/lib/orchestrate/test/orchestrateTestScenario.js +257 -4
  127. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  128. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +283 -4
  129. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  130. package/lib/orchestrate/test/orchestrateTestWrite.js +141 -3
  131. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  132. package/lib/utils/TokenUsageComputer.d.ts +5 -0
  133. package/lib/utils/TokenUsageComputer.js +29 -0
  134. package/lib/utils/TokenUsageComputer.js.map +1 -0
  135. package/package.json +10 -10
  136. package/src/AutoBeAgent.ts +40 -6
  137. package/src/AutoBeMockAgent.ts +2 -4
  138. package/src/constants/AutoBeSystemPromptConstant.ts +11 -11
  139. package/src/context/AutoBeContext.ts +8 -0
  140. package/src/context/AutoBeTokenUsage.ts +1 -1
  141. package/src/context/assertSchemaModel.ts +5 -8
  142. package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
  143. package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
  144. package/src/factory/createAutoBeContext.ts +96 -36
  145. package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -0
  146. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +9 -10
  147. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +15 -10
  148. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -11
  149. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +19 -54
  150. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +25 -22
  151. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +8 -24
  152. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +20 -3
  153. package/src/orchestrate/facade/createAutoBeFacadeController.ts +136 -0
  154. package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
  155. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
  156. package/src/orchestrate/interface/orchestrateInterface.ts +17 -6
  157. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -2
  158. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +13 -2
  159. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +16 -11
  160. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +16 -13
  161. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +19 -15
  162. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +13 -2
  163. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +16 -2
  164. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +13 -2
  165. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +11 -2
  166. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +24 -16
  167. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +13 -2
  168. package/src/orchestrate/prisma/orchestratePrisma.ts +2 -1
  169. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +15 -10
  170. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +9 -10
  171. package/src/orchestrate/prisma/orchestratePrismaReview.ts +9 -11
  172. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +2 -1
  173. package/src/orchestrate/realize/orchestrateRealize.ts +3 -2
  174. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +15 -10
  175. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +15 -10
  176. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +14 -3
  177. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +21 -6
  178. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +13 -2
  179. package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
  180. package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +5 -1
  181. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +1 -1
  182. package/src/orchestrate/test/orchestrateTest.ts +3 -2
  183. package/src/orchestrate/test/orchestrateTestCorrect.ts +14 -2
  184. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +21 -3
  185. package/src/orchestrate/test/orchestrateTestScenario.ts +13 -2
  186. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +13 -2
  187. package/src/orchestrate/test/orchestrateTestWrite.ts +13 -2
  188. package/src/utils/TokenUsageComputer.ts +35 -0
  189. package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
  190. package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
  191. package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
  192. package/lib/factory/createAutoBeApplication.js +0 -942
  193. package/lib/factory/createAutoBeApplication.js.map +0 -1
  194. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
  195. package/src/factory/createAutoBeApplication.ts +0 -123
  196. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
  197. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
  198. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
  199. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
  200. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
  201. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
  202. /package/lib/orchestrate/facade/{transformFacadeStateMessage.js → structures/transformFacadeStateMessage.js} +0 -0
  203. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
  204. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
  205. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
@@ -83,7 +83,7 @@ function step(ctx, props) {
83
83
  const pointer = {
84
84
  value: null,
85
85
  };
86
- const { tokenUsage } = yield ctx.conversate({
86
+ const { metric, tokenUsage } = yield ctx.conversate({
87
87
  source: "prismaReview",
88
88
  histories: (0, transformPrismaReviewHistories_1.transformPrismaReviewHistories)({
89
89
  analysis: (_b = (_a = ctx
@@ -114,6 +114,7 @@ function step(ctx, props) {
114
114
  review: pointer.value.review,
115
115
  plan: pointer.value.plan,
116
116
  modifications: pointer.value.modifications,
117
+ metric,
117
118
  tokenUsage,
118
119
  completed: ++props.progress.completed,
119
120
  total: props.progress.total,
@@ -125,7 +126,11 @@ function step(ctx, props) {
125
126
  }
126
127
  function createController(ctx, props) {
127
128
  (0, assertSchemaModel_1.assertSchemaModel)(ctx.model);
128
- const application = collection[ctx.model];
129
+ const application = collection[ctx.model === "chatgpt"
130
+ ? "chatgpt"
131
+ : ctx.model === "gemini"
132
+ ? "gemini"
133
+ : "claude"];
129
134
  return {
130
135
  protocol: "class",
131
136
  name: "Prisma Schema Review",
@@ -137,613 +142,1196 @@ function createController(ctx, props) {
137
142
  },
138
143
  };
139
144
  }
140
- const claude = {
141
- model: "claude",
142
- options: {
143
- reference: true,
144
- separate: null
145
- },
146
- functions: [
147
- {
148
- name: "reviewSchemaFile",
149
- parameters: {
150
- description: "Current Type: {@link IAutoBePrismaReviewApplication.IProps}",
151
- type: "object",
152
- properties: {
153
- review: {
154
- 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.\"",
155
- type: "string"
156
- },
157
- plan: {
158
- 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\"",
159
- type: "string"
160
- },
161
- modifications: {
162
- 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",
163
- type: "array",
164
- items: {
165
- $ref: "#/$defs/AutoBePrisma.IModel"
166
- }
167
- }
168
- },
169
- required: [
170
- "review",
171
- "plan",
172
- "modifications"
173
- ],
174
- additionalProperties: false,
175
- $defs: {
176
- "AutoBePrisma.IModel": {
177
- 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_)",
178
- type: "object",
179
- properties: {
180
- name: {
181
- 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\"",
182
- type: "string",
183
- pattern: "^[a-z][a-z0-9_]*$"
184
- },
185
- description: {
186
- 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...\"",
187
- type: "string"
188
- },
189
- material: {
190
- 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",
191
- type: "boolean"
192
- },
193
- stance: {
194
- 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",
195
- oneOf: [
196
- {
197
- "const": "primary"
198
- },
199
- {
200
- "const": "subsidiary"
201
- },
202
- {
203
- "const": "snapshot"
204
- }
205
- ]
206
- },
207
- primaryField: {
208
- 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.",
209
- $ref: "#/$defs/AutoBePrisma.IPrimaryField"
210
- },
211
- foreignFields: {
212
- 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.",
213
- type: "array",
214
- items: {
215
- $ref: "#/$defs/AutoBePrisma.IForeignField"
216
- }
217
- },
218
- plainFields: {
219
- 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.",
220
- type: "array",
221
- items: {
222
- $ref: "#/$defs/AutoBePrisma.IPlainField"
223
- }
224
- },
225
- uniqueIndexes: {
226
- 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).",
227
- type: "array",
228
- items: {
229
- $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
230
- }
231
- },
232
- plainIndexes: {
233
- 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.",
234
- type: "array",
235
- items: {
236
- $ref: "#/$defs/AutoBePrisma.IPlainIndex"
237
- }
238
- },
239
- ginIndexes: {
240
- 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.",
241
- type: "array",
242
- items: {
243
- $ref: "#/$defs/AutoBePrisma.IGinIndex"
244
- }
245
- }
246
- },
247
- required: [
248
- "name",
249
- "description",
250
- "material",
251
- "stance",
252
- "primaryField",
253
- "foreignFields",
254
- "plainFields",
255
- "uniqueIndexes",
256
- "plainIndexes",
257
- "ginIndexes"
258
- ]
259
- },
260
- "AutoBePrisma.IPrimaryField": {
261
- 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).",
262
- type: "object",
263
- properties: {
264
- name: {
265
- 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.",
266
- type: "string",
267
- pattern: "^[a-z][a-z0-9_]*$"
268
- },
269
- type: {
270
- 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.",
271
- "const": "uuid"
272
- },
273
- description: {
274
- 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.",
275
- type: "string"
276
- }
145
+ const collection = {
146
+ chatgpt: {
147
+ model: "chatgpt",
148
+ options: {
149
+ reference: true,
150
+ strict: false,
151
+ separate: null
152
+ },
153
+ functions: [
154
+ {
155
+ name: "reviewSchemaFile",
156
+ parameters: {
157
+ description: "Current Type: {@link IAutoBePrismaReviewApplication.IProps}",
158
+ type: "object",
159
+ properties: {
160
+ review: {
161
+ 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.\"",
162
+ type: "string"
277
163
  },
278
- required: [
279
- "name",
280
- "type",
281
- "description"
282
- ]
283
- },
284
- "AutoBePrisma.IForeignField": {
285
- 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.",
286
- type: "object",
287
- properties: {
288
- name: {
289
- 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)",
290
- type: "string",
291
- pattern: "^[a-z][a-z0-9_]*$"
292
- },
293
- type: {
294
- 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.",
295
- "const": "uuid"
296
- },
297
- description: {
298
- 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.",
299
- type: "string"
300
- },
301
- relation: {
302
- 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.",
303
- $ref: "#/$defs/AutoBePrisma.IRelation"
304
- },
305
- unique: {
306
- 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.",
307
- type: "boolean"
308
- },
309
- nullable: {
310
- 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.",
311
- type: "boolean"
312
- }
164
+ plan: {
165
+ 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\"",
166
+ type: "string"
313
167
  },
314
- required: [
315
- "name",
316
- "type",
317
- "description",
318
- "relation",
319
- "unique",
320
- "nullable"
321
- ]
322
- },
323
- "AutoBePrisma.IRelation": {
324
- 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)",
325
- type: "object",
326
- properties: {
327
- name: {
328
- 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",
329
- type: "string",
330
- pattern: "^[a-z][a-zA-Z0-9]*$"
331
- },
332
- targetModel: {
333
- 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.",
334
- type: "string"
168
+ modifications: {
169
+ 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",
170
+ type: "array",
171
+ items: {
172
+ $ref: "#/$defs/AutoBePrisma.IModel"
335
173
  }
336
- },
337
- required: [
338
- "name",
339
- "targetModel"
340
- ]
174
+ }
341
175
  },
342
- "AutoBePrisma.IPlainField": {
343
- 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.",
344
- type: "object",
345
- properties: {
346
- name: {
347
- 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",
348
- type: "string",
349
- pattern: "^[a-z][a-z0-9_]*$"
350
- },
351
- type: {
352
- 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",
353
- oneOf: [
354
- {
355
- "const": "string"
356
- },
357
- {
358
- "const": "boolean"
359
- },
360
- {
361
- "const": "uuid"
362
- },
363
- {
364
- "const": "uri"
365
- },
366
- {
367
- "const": "int"
368
- },
369
- {
370
- "const": "double"
371
- },
372
- {
373
- "const": "datetime"
176
+ required: [
177
+ "review",
178
+ "plan",
179
+ "modifications"
180
+ ],
181
+ additionalProperties: false,
182
+ $defs: {
183
+ "AutoBePrisma.IModel": {
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_)",
185
+ type: "object",
186
+ properties: {
187
+ name: {
188
+ 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\"\n\n\n@pattern ^[a-z][a-z0-9_]*$",
189
+ type: "string"
190
+ },
191
+ description: {
192
+ 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...\"",
193
+ type: "string"
194
+ },
195
+ material: {
196
+ 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",
197
+ type: "boolean"
198
+ },
199
+ stance: {
200
+ 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",
201
+ type: "string",
202
+ "enum": [
203
+ "primary",
204
+ "subsidiary",
205
+ "snapshot"
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"
374
217
  }
375
- ]
376
- },
377
- description: {
378
- 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.\"",
379
- type: "string"
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
+ }
380
247
  },
381
- nullable: {
382
- 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.",
383
- type: "boolean"
384
- }
248
+ required: [
249
+ "name",
250
+ "description",
251
+ "material",
252
+ "stance",
253
+ "primaryField",
254
+ "foreignFields",
255
+ "plainFields",
256
+ "uniqueIndexes",
257
+ "plainIndexes",
258
+ "ginIndexes"
259
+ ]
385
260
  },
386
- required: [
387
- "name",
388
- "type",
389
- "description",
390
- "nullable"
391
- ]
392
- },
393
- "AutoBePrisma.IUniqueIndex": {
394
- 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.",
395
- type: "object",
396
- properties: {
397
- fieldNames: {
398
- 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\"]",
399
- type: "array",
400
- items: {
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.\n\n\n@pattern ^[a-z][a-z0-9_]*$",
401
267
  type: "string"
402
268
  },
403
- minItems: 1,
404
- uniqueItems: true
269
+ type: {
270
+ 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.",
271
+ type: "string",
272
+ "enum": [
273
+ "uuid"
274
+ ]
275
+ },
276
+ description: {
277
+ 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.",
278
+ type: "string"
279
+ }
405
280
  },
406
- unique: {
407
- 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\".",
408
- "const": true
409
- }
281
+ required: [
282
+ "name",
283
+ "type",
284
+ "description"
285
+ ]
410
286
  },
411
- required: [
412
- "fieldNames",
413
- "unique"
414
- ]
415
- },
416
- "AutoBePrisma.IPlainIndex": {
417
- 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.",
418
- type: "object",
419
- properties: {
420
- fieldNames: {
421
- 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\"]",
422
- type: "array",
423
- items: {
287
+ "AutoBePrisma.IForeignField": {
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.",
289
+ type: "object",
290
+ properties: {
291
+ name: {
292
+ 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)\n\n\n@pattern ^[a-z][a-z0-9_]*$",
424
293
  type: "string"
425
294
  },
426
- minItems: 1,
427
- uniqueItems: true
428
- }
295
+ type: {
296
+ 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.",
297
+ type: "string",
298
+ "enum": [
299
+ "uuid"
300
+ ]
301
+ },
302
+ description: {
303
+ 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.",
304
+ type: "string"
305
+ },
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.",
308
+ $ref: "#/$defs/AutoBePrisma.IRelation"
309
+ },
310
+ unique: {
311
+ 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.",
312
+ type: "boolean"
313
+ },
314
+ nullable: {
315
+ 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.",
316
+ type: "boolean"
317
+ }
318
+ },
319
+ required: [
320
+ "name",
321
+ "type",
322
+ "description",
323
+ "relation",
324
+ "unique",
325
+ "nullable"
326
+ ]
429
327
  },
430
- required: [
431
- "fieldNames"
432
- ]
433
- },
434
- "AutoBePrisma.IGinIndex": {
435
- 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.",
436
- type: "object",
437
- properties: {
438
- fieldName: {
439
- 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.",
440
- type: "string"
441
- }
328
+ "AutoBePrisma.IRelation": {
329
+ 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)",
330
+ type: "object",
331
+ properties: {
332
+ name: {
333
+ 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\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
334
+ type: "string"
335
+ },
336
+ targetModel: {
337
+ 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.",
338
+ type: "string"
339
+ }
340
+ },
341
+ required: [
342
+ "name",
343
+ "targetModel"
344
+ ]
442
345
  },
443
- required: [
444
- "fieldName"
445
- ]
446
- }
447
- }
448
- },
449
- 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.",
450
- 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, {
451
- path: _path + ".review",
452
- expected: "string",
453
- value: input.review
454
- }), "string" === typeof input.plan || _report(_exceptionable, {
455
- path: _path + ".plan",
456
- expected: "string",
457
- value: input.plan
458
- }), (Array.isArray(input.modifications) || _report(_exceptionable, {
459
- path: _path + ".modifications",
460
- expected: "Array<AutoBePrisma.IModel>",
461
- value: input.modifications
462
- })) && input.modifications.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
463
- path: _path + ".modifications[" + _index9 + "]",
464
- expected: "AutoBePrisma.IModel",
465
- value: elem
466
- })) && _vo1(elem, _path + ".modifications[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
467
- path: _path + ".modifications[" + _index9 + "]",
468
- expected: "AutoBePrisma.IModel",
469
- value: elem
470
- })).every(flag => flag) || _report(_exceptionable, {
471
- path: _path + ".modifications",
472
- expected: "Array<AutoBePrisma.IModel>",
473
- value: input.modifications
474
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
475
- path: _path + ".name",
476
- expected: "string & SnakeCasePattern",
477
- value: input.name
478
- })) || _report(_exceptionable, {
479
- path: _path + ".name",
480
- expected: "(string & SnakeCasePattern)",
481
- value: input.name
482
- }), "string" === typeof input.description || _report(_exceptionable, {
483
- path: _path + ".description",
484
- expected: "string",
485
- value: input.description
486
- }), "boolean" === typeof input.material || _report(_exceptionable, {
487
- path: _path + ".material",
488
- expected: "boolean",
489
- value: input.material
490
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
491
- path: _path + ".stance",
492
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
493
- value: input.stance
494
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
495
- path: _path + ".primaryField",
496
- expected: "AutoBePrisma.IPrimaryField",
497
- value: input.primaryField
498
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
499
- path: _path + ".primaryField",
500
- expected: "AutoBePrisma.IPrimaryField",
501
- value: input.primaryField
502
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
503
- path: _path + ".foreignFields",
504
- expected: "Array<AutoBePrisma.IForeignField>",
505
- value: input.foreignFields
506
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
507
- path: _path + ".foreignFields[" + _index10 + "]",
508
- expected: "AutoBePrisma.IForeignField",
509
- value: elem
510
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
511
- path: _path + ".foreignFields[" + _index10 + "]",
512
- expected: "AutoBePrisma.IForeignField",
513
- value: elem
514
- })).every(flag => flag) || _report(_exceptionable, {
515
- path: _path + ".foreignFields",
516
- expected: "Array<AutoBePrisma.IForeignField>",
517
- value: input.foreignFields
518
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
519
- path: _path + ".plainFields",
520
- expected: "Array<AutoBePrisma.IPlainField>",
521
- value: input.plainFields
522
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
523
- path: _path + ".plainFields[" + _index11 + "]",
524
- expected: "AutoBePrisma.IPlainField",
525
- value: elem
526
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
527
- path: _path + ".plainFields[" + _index11 + "]",
528
- expected: "AutoBePrisma.IPlainField",
529
- value: elem
530
- })).every(flag => flag) || _report(_exceptionable, {
531
- path: _path + ".plainFields",
532
- expected: "Array<AutoBePrisma.IPlainField>",
533
- value: input.plainFields
534
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
535
- path: _path + ".uniqueIndexes",
536
- expected: "Array<AutoBePrisma.IUniqueIndex>",
537
- value: input.uniqueIndexes
538
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
539
- path: _path + ".uniqueIndexes[" + _index12 + "]",
540
- expected: "AutoBePrisma.IUniqueIndex",
541
- value: elem
542
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
543
- path: _path + ".uniqueIndexes[" + _index12 + "]",
544
- expected: "AutoBePrisma.IUniqueIndex",
545
- value: elem
546
- })).every(flag => flag) || _report(_exceptionable, {
547
- path: _path + ".uniqueIndexes",
548
- expected: "Array<AutoBePrisma.IUniqueIndex>",
549
- value: input.uniqueIndexes
550
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
551
- path: _path + ".plainIndexes",
552
- expected: "Array<AutoBePrisma.IPlainIndex>",
553
- value: input.plainIndexes
554
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
555
- path: _path + ".plainIndexes[" + _index13 + "]",
556
- expected: "AutoBePrisma.IPlainIndex",
557
- value: elem
558
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
559
- path: _path + ".plainIndexes[" + _index13 + "]",
560
- expected: "AutoBePrisma.IPlainIndex",
561
- value: elem
562
- })).every(flag => flag) || _report(_exceptionable, {
563
- path: _path + ".plainIndexes",
564
- expected: "Array<AutoBePrisma.IPlainIndex>",
565
- value: input.plainIndexes
566
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
567
- path: _path + ".ginIndexes",
568
- expected: "Array<AutoBePrisma.IGinIndex>",
569
- value: input.ginIndexes
570
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
571
- path: _path + ".ginIndexes[" + _index14 + "]",
572
- expected: "AutoBePrisma.IGinIndex",
573
- value: elem
574
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
575
- path: _path + ".ginIndexes[" + _index14 + "]",
576
- expected: "AutoBePrisma.IGinIndex",
577
- value: elem
578
- })).every(flag => flag) || _report(_exceptionable, {
579
- path: _path + ".ginIndexes",
580
- expected: "Array<AutoBePrisma.IGinIndex>",
581
- value: input.ginIndexes
582
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
583
- path: _path + ".name",
584
- expected: "string & SnakeCasePattern",
585
- value: input.name
586
- })) || _report(_exceptionable, {
587
- path: _path + ".name",
588
- expected: "(string & SnakeCasePattern)",
589
- value: input.name
590
- }), "uuid" === input.type || _report(_exceptionable, {
591
- path: _path + ".type",
592
- expected: "\"uuid\"",
593
- value: input.type
594
- }), "string" === typeof input.description || _report(_exceptionable, {
595
- path: _path + ".description",
596
- expected: "string",
597
- value: input.description
598
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
599
- path: _path + ".name",
600
- expected: "string & SnakeCasePattern",
601
- value: input.name
602
- })) || _report(_exceptionable, {
603
- path: _path + ".name",
604
- expected: "(string & SnakeCasePattern)",
605
- value: input.name
606
- }), "uuid" === input.type || _report(_exceptionable, {
607
- path: _path + ".type",
608
- expected: "\"uuid\"",
609
- value: input.type
610
- }), "string" === typeof input.description || _report(_exceptionable, {
611
- path: _path + ".description",
612
- expected: "string",
613
- value: input.description
614
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
615
- path: _path + ".relation",
616
- expected: "AutoBePrisma.IRelation",
617
- value: input.relation
618
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
619
- path: _path + ".relation",
620
- expected: "AutoBePrisma.IRelation",
621
- value: input.relation
622
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
623
- path: _path + ".unique",
624
- expected: "boolean",
625
- value: input.unique
626
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
627
- path: _path + ".nullable",
628
- expected: "boolean",
629
- value: input.nullable
630
- })].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, {
631
- path: _path + ".name",
632
- expected: "string & CamelCasePattern",
633
- value: input.name
634
- })) || _report(_exceptionable, {
635
- path: _path + ".name",
636
- expected: "(string & CamelCasePattern)",
637
- value: input.name
638
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
639
- path: _path + ".targetModel",
640
- expected: "string",
641
- value: input.targetModel
642
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
643
- path: _path + ".name",
644
- expected: "string & SnakeCasePattern",
645
- value: input.name
646
- })) || _report(_exceptionable, {
647
- path: _path + ".name",
648
- expected: "(string & SnakeCasePattern)",
649
- value: input.name
650
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
651
- path: _path + ".type",
652
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
653
- value: input.type
654
- }), "string" === typeof input.description || _report(_exceptionable, {
655
- path: _path + ".description",
656
- expected: "string",
657
- value: input.description
658
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
659
- path: _path + ".nullable",
660
- expected: "boolean",
661
- value: input.nullable
662
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
663
- path: _path + ".fieldNames",
664
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
665
- value: input.fieldNames
666
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
667
- path: _path + ".fieldNames",
668
- expected: "Array<> & MinItems<1>",
669
- value: input.fieldNames
670
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
671
- path: _path + ".fieldNames",
672
- expected: "Array<> & UniqueItems<true>",
673
- value: input.fieldNames
674
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
675
- path: _path + ".fieldNames[" + _index15 + "]",
676
- expected: "string",
677
- value: elem
678
- })).every(flag => flag)) || _report(_exceptionable, {
679
- path: _path + ".fieldNames",
680
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
681
- value: input.fieldNames
682
- }), true === input.unique || _report(_exceptionable, {
683
- path: _path + ".unique",
684
- expected: "true",
685
- value: input.unique
686
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
687
- path: _path + ".fieldNames",
688
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
689
- value: input.fieldNames
690
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
691
- path: _path + ".fieldNames",
692
- expected: "Array<> & MinItems<1>",
693
- value: input.fieldNames
694
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
695
- path: _path + ".fieldNames",
696
- expected: "Array<> & UniqueItems<true>",
697
- value: input.fieldNames
698
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
699
- path: _path + ".fieldNames[" + _index16 + "]",
700
- expected: "string",
701
- value: elem
702
- })).every(flag => flag)) || _report(_exceptionable, {
703
- path: _path + ".fieldNames",
704
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
705
- value: input.fieldNames
706
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
707
- path: _path + ".fieldName",
708
- expected: "string",
709
- value: input.fieldName
710
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
711
- if (false === __is(input)) {
712
- errors = [];
713
- _report = __typia_transform__validateReport._validateReport(errors);
714
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
715
- path: _path + "",
716
- expected: "IAutoBePrismaReviewApplication.IProps",
717
- value: input
718
- })) && _vo0(input, _path + "", true) || _report(true, {
719
- path: _path + "",
720
- expected: "IAutoBePrismaReviewApplication.IProps",
721
- value: input
722
- }))(input, "$input", true);
723
- const success = 0 === errors.length;
724
- return success ? {
725
- success,
726
- data: input
727
- } : {
728
- success,
729
- errors,
730
- data: input
731
- };
732
- }
733
- return {
734
- success: true,
735
- data: input
736
- };
737
- }; })()
738
- }
739
- ]
740
- };
741
- const collection = {
742
- chatgpt: {
743
- model: "chatgpt",
744
- options: {
745
- reference: true,
746
- strict: false,
346
+ "AutoBePrisma.IPlainField": {
347
+ 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.",
348
+ type: "object",
349
+ properties: {
350
+ name: {
351
+ 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\n\n\n@pattern ^[a-z][a-z0-9_]*$",
352
+ type: "string"
353
+ },
354
+ type: {
355
+ 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",
356
+ type: "string",
357
+ "enum": [
358
+ "string",
359
+ "boolean",
360
+ "uuid",
361
+ "uri",
362
+ "int",
363
+ "double",
364
+ "datetime"
365
+ ]
366
+ },
367
+ description: {
368
+ 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.\"",
369
+ type: "string"
370
+ },
371
+ nullable: {
372
+ 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.",
373
+ type: "boolean"
374
+ }
375
+ },
376
+ required: [
377
+ "name",
378
+ "type",
379
+ "description",
380
+ "nullable"
381
+ ]
382
+ },
383
+ "AutoBePrisma.IUniqueIndex": {
384
+ 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.",
385
+ type: "object",
386
+ properties: {
387
+ fieldNames: {
388
+ 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\"]\n\n\n@minItems 1\n@uniqueItems",
389
+ type: "array",
390
+ items: {
391
+ type: "string"
392
+ }
393
+ },
394
+ unique: {
395
+ 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\".",
396
+ type: "boolean",
397
+ "enum": [
398
+ true
399
+ ]
400
+ }
401
+ },
402
+ required: [
403
+ "fieldNames",
404
+ "unique"
405
+ ]
406
+ },
407
+ "AutoBePrisma.IPlainIndex": {
408
+ 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.",
409
+ type: "object",
410
+ properties: {
411
+ fieldNames: {
412
+ 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\"]\n\n\n@minItems 1\n@uniqueItems",
413
+ type: "array",
414
+ items: {
415
+ type: "string"
416
+ }
417
+ }
418
+ },
419
+ required: [
420
+ "fieldNames"
421
+ ]
422
+ },
423
+ "AutoBePrisma.IGinIndex": {
424
+ 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.",
425
+ type: "object",
426
+ properties: {
427
+ fieldName: {
428
+ 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.",
429
+ type: "string"
430
+ }
431
+ },
432
+ required: [
433
+ "fieldName"
434
+ ]
435
+ }
436
+ }
437
+ },
438
+ 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.",
439
+ 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, {
440
+ path: _path + ".review",
441
+ expected: "string",
442
+ value: input.review
443
+ }), "string" === typeof input.plan || _report(_exceptionable, {
444
+ path: _path + ".plan",
445
+ expected: "string",
446
+ value: input.plan
447
+ }), (Array.isArray(input.modifications) || _report(_exceptionable, {
448
+ path: _path + ".modifications",
449
+ expected: "Array<AutoBePrisma.IModel>",
450
+ value: input.modifications
451
+ })) && input.modifications.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
452
+ path: _path + ".modifications[" + _index9 + "]",
453
+ expected: "AutoBePrisma.IModel",
454
+ value: elem
455
+ })) && _vo1(elem, _path + ".modifications[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
456
+ path: _path + ".modifications[" + _index9 + "]",
457
+ expected: "AutoBePrisma.IModel",
458
+ value: elem
459
+ })).every(flag => flag) || _report(_exceptionable, {
460
+ path: _path + ".modifications",
461
+ expected: "Array<AutoBePrisma.IModel>",
462
+ value: input.modifications
463
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
464
+ path: _path + ".name",
465
+ expected: "string & SnakeCasePattern",
466
+ value: input.name
467
+ })) || _report(_exceptionable, {
468
+ path: _path + ".name",
469
+ expected: "(string & SnakeCasePattern)",
470
+ value: input.name
471
+ }), "string" === typeof input.description || _report(_exceptionable, {
472
+ path: _path + ".description",
473
+ expected: "string",
474
+ value: input.description
475
+ }), "boolean" === typeof input.material || _report(_exceptionable, {
476
+ path: _path + ".material",
477
+ expected: "boolean",
478
+ value: input.material
479
+ }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
480
+ path: _path + ".stance",
481
+ expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
482
+ value: input.stance
483
+ }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
484
+ path: _path + ".primaryField",
485
+ expected: "AutoBePrisma.IPrimaryField",
486
+ value: input.primaryField
487
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
488
+ path: _path + ".primaryField",
489
+ expected: "AutoBePrisma.IPrimaryField",
490
+ value: input.primaryField
491
+ }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
492
+ path: _path + ".foreignFields",
493
+ expected: "Array<AutoBePrisma.IForeignField>",
494
+ value: input.foreignFields
495
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
496
+ path: _path + ".foreignFields[" + _index10 + "]",
497
+ expected: "AutoBePrisma.IForeignField",
498
+ value: elem
499
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
500
+ path: _path + ".foreignFields[" + _index10 + "]",
501
+ expected: "AutoBePrisma.IForeignField",
502
+ value: elem
503
+ })).every(flag => flag) || _report(_exceptionable, {
504
+ path: _path + ".foreignFields",
505
+ expected: "Array<AutoBePrisma.IForeignField>",
506
+ value: input.foreignFields
507
+ }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
508
+ path: _path + ".plainFields",
509
+ expected: "Array<AutoBePrisma.IPlainField>",
510
+ value: input.plainFields
511
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
512
+ path: _path + ".plainFields[" + _index11 + "]",
513
+ expected: "AutoBePrisma.IPlainField",
514
+ value: elem
515
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
516
+ path: _path + ".plainFields[" + _index11 + "]",
517
+ expected: "AutoBePrisma.IPlainField",
518
+ value: elem
519
+ })).every(flag => flag) || _report(_exceptionable, {
520
+ path: _path + ".plainFields",
521
+ expected: "Array<AutoBePrisma.IPlainField>",
522
+ value: input.plainFields
523
+ }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
524
+ path: _path + ".uniqueIndexes",
525
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
526
+ value: input.uniqueIndexes
527
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
528
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
529
+ expected: "AutoBePrisma.IUniqueIndex",
530
+ value: elem
531
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
532
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
533
+ expected: "AutoBePrisma.IUniqueIndex",
534
+ value: elem
535
+ })).every(flag => flag) || _report(_exceptionable, {
536
+ path: _path + ".uniqueIndexes",
537
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
538
+ value: input.uniqueIndexes
539
+ }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
540
+ path: _path + ".plainIndexes",
541
+ expected: "Array<AutoBePrisma.IPlainIndex>",
542
+ value: input.plainIndexes
543
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
544
+ path: _path + ".plainIndexes[" + _index13 + "]",
545
+ expected: "AutoBePrisma.IPlainIndex",
546
+ value: elem
547
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
548
+ path: _path + ".plainIndexes[" + _index13 + "]",
549
+ expected: "AutoBePrisma.IPlainIndex",
550
+ value: elem
551
+ })).every(flag => flag) || _report(_exceptionable, {
552
+ path: _path + ".plainIndexes",
553
+ expected: "Array<AutoBePrisma.IPlainIndex>",
554
+ value: input.plainIndexes
555
+ }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
556
+ path: _path + ".ginIndexes",
557
+ expected: "Array<AutoBePrisma.IGinIndex>",
558
+ value: input.ginIndexes
559
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
560
+ path: _path + ".ginIndexes[" + _index14 + "]",
561
+ expected: "AutoBePrisma.IGinIndex",
562
+ value: elem
563
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
564
+ path: _path + ".ginIndexes[" + _index14 + "]",
565
+ expected: "AutoBePrisma.IGinIndex",
566
+ value: elem
567
+ })).every(flag => flag) || _report(_exceptionable, {
568
+ path: _path + ".ginIndexes",
569
+ expected: "Array<AutoBePrisma.IGinIndex>",
570
+ value: input.ginIndexes
571
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
572
+ path: _path + ".name",
573
+ expected: "string & SnakeCasePattern",
574
+ value: input.name
575
+ })) || _report(_exceptionable, {
576
+ path: _path + ".name",
577
+ expected: "(string & SnakeCasePattern)",
578
+ value: input.name
579
+ }), "uuid" === input.type || _report(_exceptionable, {
580
+ path: _path + ".type",
581
+ expected: "\"uuid\"",
582
+ value: input.type
583
+ }), "string" === typeof input.description || _report(_exceptionable, {
584
+ path: _path + ".description",
585
+ expected: "string",
586
+ value: input.description
587
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
588
+ path: _path + ".name",
589
+ expected: "string & SnakeCasePattern",
590
+ value: input.name
591
+ })) || _report(_exceptionable, {
592
+ path: _path + ".name",
593
+ expected: "(string & SnakeCasePattern)",
594
+ value: input.name
595
+ }), "uuid" === input.type || _report(_exceptionable, {
596
+ path: _path + ".type",
597
+ expected: "\"uuid\"",
598
+ value: input.type
599
+ }), "string" === typeof input.description || _report(_exceptionable, {
600
+ path: _path + ".description",
601
+ expected: "string",
602
+ value: input.description
603
+ }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
604
+ path: _path + ".relation",
605
+ expected: "AutoBePrisma.IRelation",
606
+ value: input.relation
607
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
608
+ path: _path + ".relation",
609
+ expected: "AutoBePrisma.IRelation",
610
+ value: input.relation
611
+ }), "boolean" === typeof input.unique || _report(_exceptionable, {
612
+ path: _path + ".unique",
613
+ expected: "boolean",
614
+ value: input.unique
615
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
616
+ path: _path + ".nullable",
617
+ expected: "boolean",
618
+ value: input.nullable
619
+ })].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, {
620
+ path: _path + ".name",
621
+ expected: "string & CamelCasePattern",
622
+ value: input.name
623
+ })) || _report(_exceptionable, {
624
+ path: _path + ".name",
625
+ expected: "(string & CamelCasePattern)",
626
+ value: input.name
627
+ }), "string" === typeof input.targetModel || _report(_exceptionable, {
628
+ path: _path + ".targetModel",
629
+ expected: "string",
630
+ value: input.targetModel
631
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
632
+ path: _path + ".name",
633
+ expected: "string & SnakeCasePattern",
634
+ value: input.name
635
+ })) || _report(_exceptionable, {
636
+ path: _path + ".name",
637
+ expected: "(string & SnakeCasePattern)",
638
+ value: input.name
639
+ }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
640
+ path: _path + ".type",
641
+ expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
642
+ value: input.type
643
+ }), "string" === typeof input.description || _report(_exceptionable, {
644
+ path: _path + ".description",
645
+ expected: "string",
646
+ value: input.description
647
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
648
+ path: _path + ".nullable",
649
+ expected: "boolean",
650
+ value: input.nullable
651
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
652
+ path: _path + ".fieldNames",
653
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
654
+ value: input.fieldNames
655
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
656
+ path: _path + ".fieldNames",
657
+ expected: "Array<> & MinItems<1>",
658
+ value: input.fieldNames
659
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
660
+ path: _path + ".fieldNames",
661
+ expected: "Array<> & UniqueItems<true>",
662
+ value: input.fieldNames
663
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
664
+ path: _path + ".fieldNames[" + _index15 + "]",
665
+ expected: "string",
666
+ value: elem
667
+ })).every(flag => flag)) || _report(_exceptionable, {
668
+ path: _path + ".fieldNames",
669
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
670
+ value: input.fieldNames
671
+ }), true === input.unique || _report(_exceptionable, {
672
+ path: _path + ".unique",
673
+ expected: "true",
674
+ value: input.unique
675
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
676
+ path: _path + ".fieldNames",
677
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
678
+ value: input.fieldNames
679
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
680
+ path: _path + ".fieldNames",
681
+ expected: "Array<> & MinItems<1>",
682
+ value: input.fieldNames
683
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
684
+ path: _path + ".fieldNames",
685
+ expected: "Array<> & UniqueItems<true>",
686
+ value: input.fieldNames
687
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
688
+ path: _path + ".fieldNames[" + _index16 + "]",
689
+ expected: "string",
690
+ value: elem
691
+ })).every(flag => flag)) || _report(_exceptionable, {
692
+ path: _path + ".fieldNames",
693
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
694
+ value: input.fieldNames
695
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
696
+ path: _path + ".fieldName",
697
+ expected: "string",
698
+ value: input.fieldName
699
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
700
+ if (false === __is(input)) {
701
+ errors = [];
702
+ _report = __typia_transform__validateReport._validateReport(errors);
703
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
704
+ path: _path + "",
705
+ expected: "IAutoBePrismaReviewApplication.IProps",
706
+ value: input
707
+ })) && _vo0(input, _path + "", true) || _report(true, {
708
+ path: _path + "",
709
+ expected: "IAutoBePrismaReviewApplication.IProps",
710
+ value: input
711
+ }))(input, "$input", true);
712
+ const success = 0 === errors.length;
713
+ return success ? {
714
+ success,
715
+ data: input
716
+ } : {
717
+ success,
718
+ errors,
719
+ data: input
720
+ };
721
+ }
722
+ return {
723
+ success: true,
724
+ data: input
725
+ };
726
+ }; })()
727
+ }
728
+ ]
729
+ },
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,
747
1335
  separate: null
748
1336
  },
749
1337
  functions: [
@@ -777,7 +1365,7 @@ const collection = {
777
1365
  additionalProperties: false,
778
1366
  $defs: {
779
1367
  "AutoBePrisma.IModel": {
780
- 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.",
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_)",
781
1369
  type: "object",
782
1370
  properties: {
783
1371
  name: {
@@ -802,6 +1390,7 @@ const collection = {
802
1390
  ]
803
1391
  },
804
1392
  primaryField: {
1393
+ 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.",
805
1394
  $ref: "#/$defs/AutoBePrisma.IPrimaryField"
806
1395
  },
807
1396
  foreignFields: {
@@ -880,7 +1469,7 @@ const collection = {
880
1469
  ]
881
1470
  },
882
1471
  "AutoBePrisma.IForeignField": {
883
- 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.",
1472
+ 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.",
884
1473
  type: "object",
885
1474
  properties: {
886
1475
  name: {
@@ -899,6 +1488,7 @@ const collection = {
899
1488
  type: "string"
900
1489
  },
901
1490
  relation: {
1491
+ 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.",
902
1492
  $ref: "#/$defs/AutoBePrisma.IRelation"
903
1493
  },
904
1494
  unique: {
@@ -1321,9 +1911,5 @@ const collection = {
1321
1911
  }
1322
1912
  ]
1323
1913
  },
1324
- claude,
1325
- llama: claude,
1326
- deepseek: claude,
1327
- "3.1": claude,
1328
1914
  };
1329
1915
  //# sourceMappingURL=orchestratePrismaReview.js.map