@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
@@ -139,7 +139,7 @@ function execute(ctx, failure) {
139
139
  const pointer = {
140
140
  value: null,
141
141
  };
142
- const { tokenUsage } = yield ctx.conversate({
142
+ const { metric, tokenUsage } = yield ctx.conversate({
143
143
  source: "prismaCorrect",
144
144
  histories: (0, transformPrismaCorrectHistories_1.transformPrismaCorrectHistories)(failure),
145
145
  controller: createController({
@@ -170,6 +170,7 @@ function execute(ctx, failure) {
170
170
  failure,
171
171
  planning: pointer.value.planning,
172
172
  correction: correction,
173
+ metric,
173
174
  tokenUsage,
174
175
  step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
175
176
  created_at: new Date().toISOString(),
@@ -179,7 +180,11 @@ function execute(ctx, failure) {
179
180
  }
180
181
  function createController(props) {
181
182
  (0, assertSchemaModel_1.assertSchemaModel)(props.model);
182
- const application = collection[props.model];
183
+ const application = collection[props.model === "chatgpt"
184
+ ? "chatgpt"
185
+ : props.model === "gemini"
186
+ ? "gemini"
187
+ : "claude"];
183
188
  return {
184
189
  protocol: "class",
185
190
  name: "Prisma Compiler",
@@ -195,604 +200,1178 @@ const getTableCount = (failure) => {
195
200
  const unique = new Set(failure.errors.map((error) => { var _a; return (_a = error.table) !== null && _a !== void 0 ? _a : null; }));
196
201
  return unique.size;
197
202
  };
198
- const claude = {
199
- model: "claude",
200
- options: {
201
- reference: true,
202
- separate: null
203
- },
204
- functions: [
205
- {
206
- name: "correctPrismaSchemaFiles",
207
- parameters: {
208
- description: "Current Type: {@link IAutoBePrismaCorrectApplication.IProps}",
209
- type: "object",
210
- properties: {
211
- planning: {
212
- description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types,\n indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these",
213
- type: "string"
214
- },
215
- models: {
216
- description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\n\uD83D\uDD0D Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\n\uD83D\uDCDD Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\n\u26A0\uFE0F Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\n\uD83C\uDFAF Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models",
217
- type: "array",
218
- items: {
219
- $ref: "#/$defs/AutoBePrisma.IModel"
220
- }
221
- }
222
- },
223
- required: [
224
- "planning",
225
- "models"
226
- ],
227
- additionalProperties: false,
228
- $defs: {
229
- "AutoBePrisma.IModel": {
230
- 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_)",
231
- type: "object",
232
- properties: {
233
- name: {
234
- 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\"",
235
- type: "string",
236
- pattern: "^[a-z][a-z0-9_]*$"
237
- },
238
- description: {
239
- 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...\"",
240
- type: "string"
241
- },
242
- material: {
243
- 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",
244
- type: "boolean"
245
- },
246
- stance: {
247
- 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",
248
- oneOf: [
249
- {
250
- "const": "primary"
251
- },
252
- {
253
- "const": "subsidiary"
254
- },
255
- {
256
- "const": "snapshot"
257
- }
258
- ]
259
- },
260
- primaryField: {
261
- 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.",
262
- $ref: "#/$defs/AutoBePrisma.IPrimaryField"
263
- },
264
- foreignFields: {
265
- 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.",
266
- type: "array",
267
- items: {
268
- $ref: "#/$defs/AutoBePrisma.IForeignField"
269
- }
270
- },
271
- plainFields: {
272
- 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.",
273
- type: "array",
274
- items: {
275
- $ref: "#/$defs/AutoBePrisma.IPlainField"
276
- }
277
- },
278
- uniqueIndexes: {
279
- 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).",
280
- type: "array",
281
- items: {
282
- $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
283
- }
284
- },
285
- plainIndexes: {
286
- 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.",
287
- type: "array",
288
- items: {
289
- $ref: "#/$defs/AutoBePrisma.IPlainIndex"
290
- }
291
- },
292
- ginIndexes: {
293
- 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.",
294
- type: "array",
295
- items: {
296
- $ref: "#/$defs/AutoBePrisma.IGinIndex"
297
- }
298
- }
203
+ const collection = {
204
+ chatgpt: {
205
+ model: "chatgpt",
206
+ options: {
207
+ reference: true,
208
+ strict: false,
209
+ separate: null
210
+ },
211
+ functions: [
212
+ {
213
+ name: "correctPrismaSchemaFiles",
214
+ parameters: {
215
+ description: "Current Type: {@link IAutoBePrismaCorrectApplication.IProps}",
216
+ type: "object",
217
+ properties: {
218
+ planning: {
219
+ description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types,\n indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these",
220
+ type: "string"
299
221
  },
300
- required: [
301
- "name",
302
- "description",
303
- "material",
304
- "stance",
305
- "primaryField",
306
- "foreignFields",
307
- "plainFields",
308
- "uniqueIndexes",
309
- "plainIndexes",
310
- "ginIndexes"
311
- ]
312
- },
313
- "AutoBePrisma.IPrimaryField": {
314
- 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).",
315
- type: "object",
316
- properties: {
317
- name: {
318
- 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.",
319
- type: "string",
320
- pattern: "^[a-z][a-z0-9_]*$"
321
- },
322
- type: {
323
- 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.",
324
- "const": "uuid"
325
- },
326
- description: {
327
- 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.",
328
- type: "string"
222
+ models: {
223
+ description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\n\uD83D\uDD0D Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\n\uD83D\uDCDD Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\n\u26A0\uFE0F Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\n\uD83C\uDFAF Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models",
224
+ type: "array",
225
+ items: {
226
+ $ref: "#/$defs/AutoBePrisma.IModel"
329
227
  }
330
- },
331
- required: [
332
- "name",
333
- "type",
334
- "description"
335
- ]
228
+ }
336
229
  },
337
- "AutoBePrisma.IForeignField": {
338
- 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.",
339
- type: "object",
340
- properties: {
341
- name: {
342
- 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)",
343
- type: "string",
344
- pattern: "^[a-z][a-z0-9_]*$"
345
- },
346
- type: {
347
- 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.",
348
- "const": "uuid"
349
- },
350
- description: {
351
- 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.",
352
- type: "string"
353
- },
354
- relation: {
355
- 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.",
356
- $ref: "#/$defs/AutoBePrisma.IRelation"
357
- },
358
- unique: {
359
- 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.",
360
- type: "boolean"
230
+ required: [
231
+ "planning",
232
+ "models"
233
+ ],
234
+ additionalProperties: false,
235
+ $defs: {
236
+ "AutoBePrisma.IModel": {
237
+ 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_)",
238
+ type: "object",
239
+ properties: {
240
+ name: {
241
+ 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_]*$",
242
+ type: "string"
243
+ },
244
+ description: {
245
+ 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...\"",
246
+ type: "string"
247
+ },
248
+ material: {
249
+ 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",
250
+ type: "boolean"
251
+ },
252
+ stance: {
253
+ 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",
254
+ type: "string",
255
+ "enum": [
256
+ "primary",
257
+ "subsidiary",
258
+ "snapshot"
259
+ ]
260
+ },
261
+ primaryField: {
262
+ 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.",
263
+ $ref: "#/$defs/AutoBePrisma.IPrimaryField"
264
+ },
265
+ foreignFields: {
266
+ 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.",
267
+ type: "array",
268
+ items: {
269
+ $ref: "#/$defs/AutoBePrisma.IForeignField"
270
+ }
271
+ },
272
+ plainFields: {
273
+ 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.",
274
+ type: "array",
275
+ items: {
276
+ $ref: "#/$defs/AutoBePrisma.IPlainField"
277
+ }
278
+ },
279
+ uniqueIndexes: {
280
+ 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).",
281
+ type: "array",
282
+ items: {
283
+ $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
284
+ }
285
+ },
286
+ plainIndexes: {
287
+ 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.",
288
+ type: "array",
289
+ items: {
290
+ $ref: "#/$defs/AutoBePrisma.IPlainIndex"
291
+ }
292
+ },
293
+ ginIndexes: {
294
+ 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.",
295
+ type: "array",
296
+ items: {
297
+ $ref: "#/$defs/AutoBePrisma.IGinIndex"
298
+ }
299
+ }
361
300
  },
362
- nullable: {
363
- 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.",
364
- type: "boolean"
365
- }
301
+ required: [
302
+ "name",
303
+ "description",
304
+ "material",
305
+ "stance",
306
+ "primaryField",
307
+ "foreignFields",
308
+ "plainFields",
309
+ "uniqueIndexes",
310
+ "plainIndexes",
311
+ "ginIndexes"
312
+ ]
366
313
  },
367
- required: [
368
- "name",
369
- "type",
370
- "description",
371
- "relation",
372
- "unique",
373
- "nullable"
374
- ]
375
- },
376
- "AutoBePrisma.IRelation": {
377
- 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)",
378
- type: "object",
379
- properties: {
380
- name: {
381
- 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",
382
- type: "string",
383
- pattern: "^[a-z][a-zA-Z0-9]*$"
314
+ "AutoBePrisma.IPrimaryField": {
315
+ 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).",
316
+ type: "object",
317
+ properties: {
318
+ name: {
319
+ 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_]*$",
320
+ type: "string"
321
+ },
322
+ type: {
323
+ 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.",
324
+ type: "string",
325
+ "enum": [
326
+ "uuid"
327
+ ]
328
+ },
329
+ description: {
330
+ 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.",
331
+ type: "string"
332
+ }
384
333
  },
385
- targetModel: {
386
- 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.",
387
- type: "string"
388
- }
334
+ required: [
335
+ "name",
336
+ "type",
337
+ "description"
338
+ ]
389
339
  },
390
- required: [
391
- "name",
392
- "targetModel"
393
- ]
394
- },
395
- "AutoBePrisma.IPlainField": {
396
- 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.",
397
- type: "object",
398
- properties: {
399
- name: {
400
- 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",
401
- type: "string",
402
- pattern: "^[a-z][a-z0-9_]*$"
403
- },
404
- type: {
405
- 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",
406
- oneOf: [
407
- {
408
- "const": "string"
409
- },
410
- {
411
- "const": "boolean"
412
- },
413
- {
414
- "const": "uuid"
415
- },
416
- {
417
- "const": "uri"
418
- },
419
- {
420
- "const": "int"
421
- },
422
- {
423
- "const": "double"
424
- },
425
- {
426
- "const": "datetime"
427
- }
428
- ]
429
- },
430
- description: {
431
- 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.\"",
432
- type: "string"
340
+ "AutoBePrisma.IForeignField": {
341
+ 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.",
342
+ type: "object",
343
+ properties: {
344
+ name: {
345
+ 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_]*$",
346
+ type: "string"
347
+ },
348
+ type: {
349
+ 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.",
350
+ type: "string",
351
+ "enum": [
352
+ "uuid"
353
+ ]
354
+ },
355
+ description: {
356
+ 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.",
357
+ type: "string"
358
+ },
359
+ relation: {
360
+ 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.",
361
+ $ref: "#/$defs/AutoBePrisma.IRelation"
362
+ },
363
+ unique: {
364
+ 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.",
365
+ type: "boolean"
366
+ },
367
+ nullable: {
368
+ 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.",
369
+ type: "boolean"
370
+ }
433
371
  },
434
- nullable: {
435
- 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.",
436
- type: "boolean"
437
- }
372
+ required: [
373
+ "name",
374
+ "type",
375
+ "description",
376
+ "relation",
377
+ "unique",
378
+ "nullable"
379
+ ]
438
380
  },
439
- required: [
440
- "name",
441
- "type",
442
- "description",
443
- "nullable"
444
- ]
445
- },
446
- "AutoBePrisma.IUniqueIndex": {
447
- 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.",
448
- type: "object",
449
- properties: {
450
- fieldNames: {
451
- 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\"]",
452
- type: "array",
453
- items: {
381
+ "AutoBePrisma.IRelation": {
382
+ 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)",
383
+ type: "object",
384
+ properties: {
385
+ name: {
386
+ 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]*$",
454
387
  type: "string"
455
388
  },
456
- minItems: 1,
457
- uniqueItems: true
389
+ targetModel: {
390
+ 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.",
391
+ type: "string"
392
+ }
458
393
  },
459
- unique: {
460
- 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\".",
461
- "const": true
462
- }
394
+ required: [
395
+ "name",
396
+ "targetModel"
397
+ ]
463
398
  },
464
- required: [
465
- "fieldNames",
466
- "unique"
467
- ]
468
- },
469
- "AutoBePrisma.IPlainIndex": {
470
- 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.",
471
- type: "object",
472
- properties: {
473
- fieldNames: {
474
- 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\"]",
475
- type: "array",
476
- items: {
399
+ "AutoBePrisma.IPlainField": {
400
+ 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.",
401
+ type: "object",
402
+ properties: {
403
+ name: {
404
+ 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_]*$",
477
405
  type: "string"
478
406
  },
479
- minItems: 1,
480
- uniqueItems: true
481
- }
482
- },
483
- required: [
484
- "fieldNames"
485
- ]
486
- },
487
- "AutoBePrisma.IGinIndex": {
488
- 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.",
489
- type: "object",
490
- properties: {
491
- fieldName: {
492
- 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.",
493
- type: "string"
494
- }
495
- },
496
- required: [
497
- "fieldName"
498
- ]
499
- }
500
- }
501
- },
502
- description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
503
- validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.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.planning || _report(_exceptionable, {
504
- path: _path + ".planning",
505
- expected: "string",
506
- value: input.planning
507
- }), (Array.isArray(input.models) || _report(_exceptionable, {
508
- path: _path + ".models",
509
- expected: "Array<AutoBePrisma.IModel>",
510
- value: input.models
511
- })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
512
- path: _path + ".models[" + _index9 + "]",
513
- expected: "AutoBePrisma.IModel",
514
- value: elem
515
- })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
516
- path: _path + ".models[" + _index9 + "]",
517
- expected: "AutoBePrisma.IModel",
518
- value: elem
519
- })).every(flag => flag) || _report(_exceptionable, {
520
- path: _path + ".models",
521
- expected: "Array<AutoBePrisma.IModel>",
522
- value: input.models
523
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
524
- path: _path + ".name",
525
- expected: "string & SnakeCasePattern",
526
- value: input.name
527
- })) || _report(_exceptionable, {
528
- path: _path + ".name",
529
- expected: "(string & SnakeCasePattern)",
530
- value: input.name
531
- }), "string" === typeof input.description || _report(_exceptionable, {
532
- path: _path + ".description",
533
- expected: "string",
534
- value: input.description
535
- }), "boolean" === typeof input.material || _report(_exceptionable, {
536
- path: _path + ".material",
537
- expected: "boolean",
538
- value: input.material
539
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
540
- path: _path + ".stance",
541
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
542
- value: input.stance
543
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
544
- path: _path + ".primaryField",
545
- expected: "AutoBePrisma.IPrimaryField",
546
- value: input.primaryField
547
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
548
- path: _path + ".primaryField",
549
- expected: "AutoBePrisma.IPrimaryField",
550
- value: input.primaryField
551
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
552
- path: _path + ".foreignFields",
553
- expected: "Array<AutoBePrisma.IForeignField>",
554
- value: input.foreignFields
555
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
556
- path: _path + ".foreignFields[" + _index10 + "]",
557
- expected: "AutoBePrisma.IForeignField",
558
- value: elem
559
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
560
- path: _path + ".foreignFields[" + _index10 + "]",
561
- expected: "AutoBePrisma.IForeignField",
562
- value: elem
563
- })).every(flag => flag) || _report(_exceptionable, {
564
- path: _path + ".foreignFields",
565
- expected: "Array<AutoBePrisma.IForeignField>",
566
- value: input.foreignFields
567
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
568
- path: _path + ".plainFields",
569
- expected: "Array<AutoBePrisma.IPlainField>",
570
- value: input.plainFields
571
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
572
- path: _path + ".plainFields[" + _index11 + "]",
573
- expected: "AutoBePrisma.IPlainField",
574
- value: elem
575
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
576
- path: _path + ".plainFields[" + _index11 + "]",
577
- expected: "AutoBePrisma.IPlainField",
578
- value: elem
579
- })).every(flag => flag) || _report(_exceptionable, {
580
- path: _path + ".plainFields",
581
- expected: "Array<AutoBePrisma.IPlainField>",
582
- value: input.plainFields
583
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
584
- path: _path + ".uniqueIndexes",
585
- expected: "Array<AutoBePrisma.IUniqueIndex>",
586
- value: input.uniqueIndexes
587
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
588
- path: _path + ".uniqueIndexes[" + _index12 + "]",
589
- expected: "AutoBePrisma.IUniqueIndex",
590
- value: elem
591
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
592
- path: _path + ".uniqueIndexes[" + _index12 + "]",
593
- expected: "AutoBePrisma.IUniqueIndex",
594
- value: elem
595
- })).every(flag => flag) || _report(_exceptionable, {
596
- path: _path + ".uniqueIndexes",
597
- expected: "Array<AutoBePrisma.IUniqueIndex>",
598
- value: input.uniqueIndexes
599
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
600
- path: _path + ".plainIndexes",
601
- expected: "Array<AutoBePrisma.IPlainIndex>",
602
- value: input.plainIndexes
603
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
604
- path: _path + ".plainIndexes[" + _index13 + "]",
605
- expected: "AutoBePrisma.IPlainIndex",
606
- value: elem
607
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
608
- path: _path + ".plainIndexes[" + _index13 + "]",
609
- expected: "AutoBePrisma.IPlainIndex",
610
- value: elem
611
- })).every(flag => flag) || _report(_exceptionable, {
612
- path: _path + ".plainIndexes",
613
- expected: "Array<AutoBePrisma.IPlainIndex>",
614
- value: input.plainIndexes
615
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
616
- path: _path + ".ginIndexes",
617
- expected: "Array<AutoBePrisma.IGinIndex>",
618
- value: input.ginIndexes
619
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
620
- path: _path + ".ginIndexes[" + _index14 + "]",
621
- expected: "AutoBePrisma.IGinIndex",
622
- value: elem
623
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
624
- path: _path + ".ginIndexes[" + _index14 + "]",
625
- expected: "AutoBePrisma.IGinIndex",
626
- value: elem
627
- })).every(flag => flag) || _report(_exceptionable, {
628
- path: _path + ".ginIndexes",
629
- expected: "Array<AutoBePrisma.IGinIndex>",
630
- value: input.ginIndexes
631
- })].every(flag => flag); const _vo2 = (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
- }), "uuid" === input.type || _report(_exceptionable, {
640
- path: _path + ".type",
641
- expected: "\"uuid\"",
642
- value: input.type
643
- }), "string" === typeof input.description || _report(_exceptionable, {
644
- path: _path + ".description",
645
- expected: "string",
646
- value: input.description
647
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
648
- path: _path + ".name",
649
- expected: "string & SnakeCasePattern",
650
- value: input.name
651
- })) || _report(_exceptionable, {
652
- path: _path + ".name",
653
- expected: "(string & SnakeCasePattern)",
654
- value: input.name
655
- }), "uuid" === input.type || _report(_exceptionable, {
656
- path: _path + ".type",
657
- expected: "\"uuid\"",
658
- value: input.type
659
- }), "string" === typeof input.description || _report(_exceptionable, {
660
- path: _path + ".description",
661
- expected: "string",
662
- value: input.description
663
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
664
- path: _path + ".relation",
665
- expected: "AutoBePrisma.IRelation",
666
- value: input.relation
667
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
668
- path: _path + ".relation",
669
- expected: "AutoBePrisma.IRelation",
670
- value: input.relation
671
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
672
- path: _path + ".unique",
673
- expected: "boolean",
674
- value: input.unique
675
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
676
- path: _path + ".nullable",
677
- expected: "boolean",
678
- value: input.nullable
679
- })].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, {
680
- path: _path + ".name",
681
- expected: "string & CamelCasePattern",
682
- value: input.name
683
- })) || _report(_exceptionable, {
684
- path: _path + ".name",
685
- expected: "(string & CamelCasePattern)",
686
- value: input.name
687
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
688
- path: _path + ".targetModel",
689
- expected: "string",
690
- value: input.targetModel
691
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
692
- path: _path + ".name",
693
- expected: "string & SnakeCasePattern",
694
- value: input.name
695
- })) || _report(_exceptionable, {
696
- path: _path + ".name",
697
- expected: "(string & SnakeCasePattern)",
698
- value: input.name
699
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
700
- path: _path + ".type",
701
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
702
- value: input.type
703
- }), "string" === typeof input.description || _report(_exceptionable, {
704
- path: _path + ".description",
705
- expected: "string",
706
- value: input.description
707
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
708
- path: _path + ".nullable",
709
- expected: "boolean",
710
- value: input.nullable
711
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
712
- path: _path + ".fieldNames",
713
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
714
- value: input.fieldNames
715
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
716
- path: _path + ".fieldNames",
717
- expected: "Array<> & MinItems<1>",
718
- value: input.fieldNames
719
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
720
- path: _path + ".fieldNames",
721
- expected: "Array<> & UniqueItems<true>",
722
- value: input.fieldNames
723
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
724
- path: _path + ".fieldNames[" + _index15 + "]",
725
- expected: "string",
726
- value: elem
727
- })).every(flag => flag)) || _report(_exceptionable, {
728
- path: _path + ".fieldNames",
729
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
730
- value: input.fieldNames
731
- }), true === input.unique || _report(_exceptionable, {
732
- path: _path + ".unique",
733
- expected: "true",
734
- value: input.unique
735
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
736
- path: _path + ".fieldNames",
737
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
738
- value: input.fieldNames
739
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
740
- path: _path + ".fieldNames",
741
- expected: "Array<> & MinItems<1>",
742
- value: input.fieldNames
743
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
744
- path: _path + ".fieldNames",
745
- expected: "Array<> & UniqueItems<true>",
746
- value: input.fieldNames
747
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
748
- path: _path + ".fieldNames[" + _index16 + "]",
749
- expected: "string",
750
- value: elem
751
- })).every(flag => flag)) || _report(_exceptionable, {
752
- path: _path + ".fieldNames",
753
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
754
- value: input.fieldNames
755
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
756
- path: _path + ".fieldName",
757
- expected: "string",
758
- value: input.fieldName
759
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
760
- if (false === __is(input)) {
761
- errors = [];
762
- _report = __typia_transform__validateReport._validateReport(errors);
763
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
764
- path: _path + "",
765
- expected: "IAutoBePrismaCorrectApplication.IProps",
766
- value: input
767
- })) && _vo0(input, _path + "", true) || _report(true, {
768
- path: _path + "",
769
- expected: "IAutoBePrismaCorrectApplication.IProps",
770
- value: input
771
- }))(input, "$input", true);
772
- const success = 0 === errors.length;
773
- return success ? {
774
- success,
775
- data: input
776
- } : {
777
- success,
778
- errors,
779
- data: input
780
- };
781
- }
782
- return {
783
- success: true,
784
- data: input
785
- };
786
- }; })()
787
- }
788
- ]
789
- };
790
- const collection = {
791
- chatgpt: {
792
- model: "chatgpt",
793
- options: {
794
- reference: true,
795
- strict: false,
407
+ type: {
408
+ 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",
409
+ type: "string",
410
+ "enum": [
411
+ "string",
412
+ "boolean",
413
+ "uuid",
414
+ "uri",
415
+ "int",
416
+ "double",
417
+ "datetime"
418
+ ]
419
+ },
420
+ description: {
421
+ 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.\"",
422
+ type: "string"
423
+ },
424
+ nullable: {
425
+ 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.",
426
+ type: "boolean"
427
+ }
428
+ },
429
+ required: [
430
+ "name",
431
+ "type",
432
+ "description",
433
+ "nullable"
434
+ ]
435
+ },
436
+ "AutoBePrisma.IUniqueIndex": {
437
+ 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.",
438
+ type: "object",
439
+ properties: {
440
+ fieldNames: {
441
+ 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",
442
+ type: "array",
443
+ items: {
444
+ type: "string"
445
+ }
446
+ },
447
+ unique: {
448
+ 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\".",
449
+ type: "boolean",
450
+ "enum": [
451
+ true
452
+ ]
453
+ }
454
+ },
455
+ required: [
456
+ "fieldNames",
457
+ "unique"
458
+ ]
459
+ },
460
+ "AutoBePrisma.IPlainIndex": {
461
+ 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.",
462
+ type: "object",
463
+ properties: {
464
+ fieldNames: {
465
+ 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",
466
+ type: "array",
467
+ items: {
468
+ type: "string"
469
+ }
470
+ }
471
+ },
472
+ required: [
473
+ "fieldNames"
474
+ ]
475
+ },
476
+ "AutoBePrisma.IGinIndex": {
477
+ 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.",
478
+ type: "object",
479
+ properties: {
480
+ fieldName: {
481
+ 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.",
482
+ type: "string"
483
+ }
484
+ },
485
+ required: [
486
+ "fieldName"
487
+ ]
488
+ }
489
+ }
490
+ },
491
+ description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
492
+ validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.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.planning || _report(_exceptionable, {
493
+ path: _path + ".planning",
494
+ expected: "string",
495
+ value: input.planning
496
+ }), (Array.isArray(input.models) || _report(_exceptionable, {
497
+ path: _path + ".models",
498
+ expected: "Array<AutoBePrisma.IModel>",
499
+ value: input.models
500
+ })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
501
+ path: _path + ".models[" + _index9 + "]",
502
+ expected: "AutoBePrisma.IModel",
503
+ value: elem
504
+ })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
505
+ path: _path + ".models[" + _index9 + "]",
506
+ expected: "AutoBePrisma.IModel",
507
+ value: elem
508
+ })).every(flag => flag) || _report(_exceptionable, {
509
+ path: _path + ".models",
510
+ expected: "Array<AutoBePrisma.IModel>",
511
+ value: input.models
512
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
513
+ path: _path + ".name",
514
+ expected: "string & SnakeCasePattern",
515
+ value: input.name
516
+ })) || _report(_exceptionable, {
517
+ path: _path + ".name",
518
+ expected: "(string & SnakeCasePattern)",
519
+ value: input.name
520
+ }), "string" === typeof input.description || _report(_exceptionable, {
521
+ path: _path + ".description",
522
+ expected: "string",
523
+ value: input.description
524
+ }), "boolean" === typeof input.material || _report(_exceptionable, {
525
+ path: _path + ".material",
526
+ expected: "boolean",
527
+ value: input.material
528
+ }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
529
+ path: _path + ".stance",
530
+ expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
531
+ value: input.stance
532
+ }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
533
+ path: _path + ".primaryField",
534
+ expected: "AutoBePrisma.IPrimaryField",
535
+ value: input.primaryField
536
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
537
+ path: _path + ".primaryField",
538
+ expected: "AutoBePrisma.IPrimaryField",
539
+ value: input.primaryField
540
+ }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
541
+ path: _path + ".foreignFields",
542
+ expected: "Array<AutoBePrisma.IForeignField>",
543
+ value: input.foreignFields
544
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
545
+ path: _path + ".foreignFields[" + _index10 + "]",
546
+ expected: "AutoBePrisma.IForeignField",
547
+ value: elem
548
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
549
+ path: _path + ".foreignFields[" + _index10 + "]",
550
+ expected: "AutoBePrisma.IForeignField",
551
+ value: elem
552
+ })).every(flag => flag) || _report(_exceptionable, {
553
+ path: _path + ".foreignFields",
554
+ expected: "Array<AutoBePrisma.IForeignField>",
555
+ value: input.foreignFields
556
+ }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
557
+ path: _path + ".plainFields",
558
+ expected: "Array<AutoBePrisma.IPlainField>",
559
+ value: input.plainFields
560
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
561
+ path: _path + ".plainFields[" + _index11 + "]",
562
+ expected: "AutoBePrisma.IPlainField",
563
+ value: elem
564
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
565
+ path: _path + ".plainFields[" + _index11 + "]",
566
+ expected: "AutoBePrisma.IPlainField",
567
+ value: elem
568
+ })).every(flag => flag) || _report(_exceptionable, {
569
+ path: _path + ".plainFields",
570
+ expected: "Array<AutoBePrisma.IPlainField>",
571
+ value: input.plainFields
572
+ }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
573
+ path: _path + ".uniqueIndexes",
574
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
575
+ value: input.uniqueIndexes
576
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
577
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
578
+ expected: "AutoBePrisma.IUniqueIndex",
579
+ value: elem
580
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
581
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
582
+ expected: "AutoBePrisma.IUniqueIndex",
583
+ value: elem
584
+ })).every(flag => flag) || _report(_exceptionable, {
585
+ path: _path + ".uniqueIndexes",
586
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
587
+ value: input.uniqueIndexes
588
+ }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
589
+ path: _path + ".plainIndexes",
590
+ expected: "Array<AutoBePrisma.IPlainIndex>",
591
+ value: input.plainIndexes
592
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
593
+ path: _path + ".plainIndexes[" + _index13 + "]",
594
+ expected: "AutoBePrisma.IPlainIndex",
595
+ value: elem
596
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
597
+ path: _path + ".plainIndexes[" + _index13 + "]",
598
+ expected: "AutoBePrisma.IPlainIndex",
599
+ value: elem
600
+ })).every(flag => flag) || _report(_exceptionable, {
601
+ path: _path + ".plainIndexes",
602
+ expected: "Array<AutoBePrisma.IPlainIndex>",
603
+ value: input.plainIndexes
604
+ }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
605
+ path: _path + ".ginIndexes",
606
+ expected: "Array<AutoBePrisma.IGinIndex>",
607
+ value: input.ginIndexes
608
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
609
+ path: _path + ".ginIndexes[" + _index14 + "]",
610
+ expected: "AutoBePrisma.IGinIndex",
611
+ value: elem
612
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
613
+ path: _path + ".ginIndexes[" + _index14 + "]",
614
+ expected: "AutoBePrisma.IGinIndex",
615
+ value: elem
616
+ })).every(flag => flag) || _report(_exceptionable, {
617
+ path: _path + ".ginIndexes",
618
+ expected: "Array<AutoBePrisma.IGinIndex>",
619
+ value: input.ginIndexes
620
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
621
+ path: _path + ".name",
622
+ expected: "string & SnakeCasePattern",
623
+ value: input.name
624
+ })) || _report(_exceptionable, {
625
+ path: _path + ".name",
626
+ expected: "(string & SnakeCasePattern)",
627
+ value: input.name
628
+ }), "uuid" === input.type || _report(_exceptionable, {
629
+ path: _path + ".type",
630
+ expected: "\"uuid\"",
631
+ value: input.type
632
+ }), "string" === typeof input.description || _report(_exceptionable, {
633
+ path: _path + ".description",
634
+ expected: "string",
635
+ value: input.description
636
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
637
+ path: _path + ".name",
638
+ expected: "string & SnakeCasePattern",
639
+ value: input.name
640
+ })) || _report(_exceptionable, {
641
+ path: _path + ".name",
642
+ expected: "(string & SnakeCasePattern)",
643
+ value: input.name
644
+ }), "uuid" === input.type || _report(_exceptionable, {
645
+ path: _path + ".type",
646
+ expected: "\"uuid\"",
647
+ value: input.type
648
+ }), "string" === typeof input.description || _report(_exceptionable, {
649
+ path: _path + ".description",
650
+ expected: "string",
651
+ value: input.description
652
+ }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
653
+ path: _path + ".relation",
654
+ expected: "AutoBePrisma.IRelation",
655
+ value: input.relation
656
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
657
+ path: _path + ".relation",
658
+ expected: "AutoBePrisma.IRelation",
659
+ value: input.relation
660
+ }), "boolean" === typeof input.unique || _report(_exceptionable, {
661
+ path: _path + ".unique",
662
+ expected: "boolean",
663
+ value: input.unique
664
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
665
+ path: _path + ".nullable",
666
+ expected: "boolean",
667
+ value: input.nullable
668
+ })].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, {
669
+ path: _path + ".name",
670
+ expected: "string & CamelCasePattern",
671
+ value: input.name
672
+ })) || _report(_exceptionable, {
673
+ path: _path + ".name",
674
+ expected: "(string & CamelCasePattern)",
675
+ value: input.name
676
+ }), "string" === typeof input.targetModel || _report(_exceptionable, {
677
+ path: _path + ".targetModel",
678
+ expected: "string",
679
+ value: input.targetModel
680
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
681
+ path: _path + ".name",
682
+ expected: "string & SnakeCasePattern",
683
+ value: input.name
684
+ })) || _report(_exceptionable, {
685
+ path: _path + ".name",
686
+ expected: "(string & SnakeCasePattern)",
687
+ value: input.name
688
+ }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
689
+ path: _path + ".type",
690
+ expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
691
+ value: input.type
692
+ }), "string" === typeof input.description || _report(_exceptionable, {
693
+ path: _path + ".description",
694
+ expected: "string",
695
+ value: input.description
696
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
697
+ path: _path + ".nullable",
698
+ expected: "boolean",
699
+ value: input.nullable
700
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
701
+ path: _path + ".fieldNames",
702
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
703
+ value: input.fieldNames
704
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
705
+ path: _path + ".fieldNames",
706
+ expected: "Array<> & MinItems<1>",
707
+ value: input.fieldNames
708
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
709
+ path: _path + ".fieldNames",
710
+ expected: "Array<> & UniqueItems<true>",
711
+ value: input.fieldNames
712
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
713
+ path: _path + ".fieldNames[" + _index15 + "]",
714
+ expected: "string",
715
+ value: elem
716
+ })).every(flag => flag)) || _report(_exceptionable, {
717
+ path: _path + ".fieldNames",
718
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
719
+ value: input.fieldNames
720
+ }), true === input.unique || _report(_exceptionable, {
721
+ path: _path + ".unique",
722
+ expected: "true",
723
+ value: input.unique
724
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
725
+ path: _path + ".fieldNames",
726
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
727
+ value: input.fieldNames
728
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
729
+ path: _path + ".fieldNames",
730
+ expected: "Array<> & MinItems<1>",
731
+ value: input.fieldNames
732
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
733
+ path: _path + ".fieldNames",
734
+ expected: "Array<> & UniqueItems<true>",
735
+ value: input.fieldNames
736
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
737
+ path: _path + ".fieldNames[" + _index16 + "]",
738
+ expected: "string",
739
+ value: elem
740
+ })).every(flag => flag)) || _report(_exceptionable, {
741
+ path: _path + ".fieldNames",
742
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
743
+ value: input.fieldNames
744
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
745
+ path: _path + ".fieldName",
746
+ expected: "string",
747
+ value: input.fieldName
748
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
749
+ if (false === __is(input)) {
750
+ errors = [];
751
+ _report = __typia_transform__validateReport._validateReport(errors);
752
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
753
+ path: _path + "",
754
+ expected: "IAutoBePrismaCorrectApplication.IProps",
755
+ value: input
756
+ })) && _vo0(input, _path + "", true) || _report(true, {
757
+ path: _path + "",
758
+ expected: "IAutoBePrismaCorrectApplication.IProps",
759
+ value: input
760
+ }))(input, "$input", true);
761
+ const success = 0 === errors.length;
762
+ return success ? {
763
+ success,
764
+ data: input
765
+ } : {
766
+ success,
767
+ errors,
768
+ data: input
769
+ };
770
+ }
771
+ return {
772
+ success: true,
773
+ data: input
774
+ };
775
+ }; })()
776
+ }
777
+ ]
778
+ },
779
+ claude: {
780
+ model: "claude",
781
+ options: {
782
+ reference: true,
783
+ separate: null
784
+ },
785
+ functions: [
786
+ {
787
+ name: "correctPrismaSchemaFiles",
788
+ parameters: {
789
+ description: "Current Type: {@link IAutoBePrismaCorrectApplication.IProps}",
790
+ type: "object",
791
+ properties: {
792
+ planning: {
793
+ description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types,\n indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these",
794
+ type: "string"
795
+ },
796
+ models: {
797
+ description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\n\uD83D\uDD0D Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\n\uD83D\uDCDD Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\n\u26A0\uFE0F Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\n\uD83C\uDFAF Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models",
798
+ type: "array",
799
+ items: {
800
+ $ref: "#/$defs/AutoBePrisma.IModel"
801
+ }
802
+ }
803
+ },
804
+ required: [
805
+ "planning",
806
+ "models"
807
+ ],
808
+ additionalProperties: false,
809
+ $defs: {
810
+ "AutoBePrisma.IModel": {
811
+ 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_)",
812
+ type: "object",
813
+ properties: {
814
+ name: {
815
+ 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\"",
816
+ type: "string",
817
+ pattern: "^[a-z][a-z0-9_]*$"
818
+ },
819
+ description: {
820
+ 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...\"",
821
+ type: "string"
822
+ },
823
+ material: {
824
+ 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",
825
+ type: "boolean"
826
+ },
827
+ stance: {
828
+ 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",
829
+ oneOf: [
830
+ {
831
+ "const": "primary"
832
+ },
833
+ {
834
+ "const": "subsidiary"
835
+ },
836
+ {
837
+ "const": "snapshot"
838
+ }
839
+ ]
840
+ },
841
+ primaryField: {
842
+ 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.",
843
+ $ref: "#/$defs/AutoBePrisma.IPrimaryField"
844
+ },
845
+ foreignFields: {
846
+ 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.",
847
+ type: "array",
848
+ items: {
849
+ $ref: "#/$defs/AutoBePrisma.IForeignField"
850
+ }
851
+ },
852
+ plainFields: {
853
+ 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.",
854
+ type: "array",
855
+ items: {
856
+ $ref: "#/$defs/AutoBePrisma.IPlainField"
857
+ }
858
+ },
859
+ uniqueIndexes: {
860
+ 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).",
861
+ type: "array",
862
+ items: {
863
+ $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
864
+ }
865
+ },
866
+ plainIndexes: {
867
+ 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.",
868
+ type: "array",
869
+ items: {
870
+ $ref: "#/$defs/AutoBePrisma.IPlainIndex"
871
+ }
872
+ },
873
+ ginIndexes: {
874
+ 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.",
875
+ type: "array",
876
+ items: {
877
+ $ref: "#/$defs/AutoBePrisma.IGinIndex"
878
+ }
879
+ }
880
+ },
881
+ required: [
882
+ "name",
883
+ "description",
884
+ "material",
885
+ "stance",
886
+ "primaryField",
887
+ "foreignFields",
888
+ "plainFields",
889
+ "uniqueIndexes",
890
+ "plainIndexes",
891
+ "ginIndexes"
892
+ ]
893
+ },
894
+ "AutoBePrisma.IPrimaryField": {
895
+ 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).",
896
+ type: "object",
897
+ properties: {
898
+ name: {
899
+ 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.",
900
+ type: "string",
901
+ pattern: "^[a-z][a-z0-9_]*$"
902
+ },
903
+ type: {
904
+ 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.",
905
+ "const": "uuid"
906
+ },
907
+ description: {
908
+ 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.",
909
+ type: "string"
910
+ }
911
+ },
912
+ required: [
913
+ "name",
914
+ "type",
915
+ "description"
916
+ ]
917
+ },
918
+ "AutoBePrisma.IForeignField": {
919
+ 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.",
920
+ type: "object",
921
+ properties: {
922
+ name: {
923
+ 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)",
924
+ type: "string",
925
+ pattern: "^[a-z][a-z0-9_]*$"
926
+ },
927
+ type: {
928
+ 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.",
929
+ "const": "uuid"
930
+ },
931
+ description: {
932
+ 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.",
933
+ type: "string"
934
+ },
935
+ relation: {
936
+ 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.",
937
+ $ref: "#/$defs/AutoBePrisma.IRelation"
938
+ },
939
+ unique: {
940
+ 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.",
941
+ type: "boolean"
942
+ },
943
+ nullable: {
944
+ 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.",
945
+ type: "boolean"
946
+ }
947
+ },
948
+ required: [
949
+ "name",
950
+ "type",
951
+ "description",
952
+ "relation",
953
+ "unique",
954
+ "nullable"
955
+ ]
956
+ },
957
+ "AutoBePrisma.IRelation": {
958
+ 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)",
959
+ type: "object",
960
+ properties: {
961
+ name: {
962
+ 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",
963
+ type: "string",
964
+ pattern: "^[a-z][a-zA-Z0-9]*$"
965
+ },
966
+ targetModel: {
967
+ 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.",
968
+ type: "string"
969
+ }
970
+ },
971
+ required: [
972
+ "name",
973
+ "targetModel"
974
+ ]
975
+ },
976
+ "AutoBePrisma.IPlainField": {
977
+ 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.",
978
+ type: "object",
979
+ properties: {
980
+ name: {
981
+ 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",
982
+ type: "string",
983
+ pattern: "^[a-z][a-z0-9_]*$"
984
+ },
985
+ type: {
986
+ 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",
987
+ oneOf: [
988
+ {
989
+ "const": "string"
990
+ },
991
+ {
992
+ "const": "boolean"
993
+ },
994
+ {
995
+ "const": "uuid"
996
+ },
997
+ {
998
+ "const": "uri"
999
+ },
1000
+ {
1001
+ "const": "int"
1002
+ },
1003
+ {
1004
+ "const": "double"
1005
+ },
1006
+ {
1007
+ "const": "datetime"
1008
+ }
1009
+ ]
1010
+ },
1011
+ description: {
1012
+ 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.\"",
1013
+ type: "string"
1014
+ },
1015
+ nullable: {
1016
+ 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.",
1017
+ type: "boolean"
1018
+ }
1019
+ },
1020
+ required: [
1021
+ "name",
1022
+ "type",
1023
+ "description",
1024
+ "nullable"
1025
+ ]
1026
+ },
1027
+ "AutoBePrisma.IUniqueIndex": {
1028
+ 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.",
1029
+ type: "object",
1030
+ properties: {
1031
+ fieldNames: {
1032
+ 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\"]",
1033
+ type: "array",
1034
+ items: {
1035
+ type: "string"
1036
+ },
1037
+ minItems: 1,
1038
+ uniqueItems: true
1039
+ },
1040
+ unique: {
1041
+ 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\".",
1042
+ "const": true
1043
+ }
1044
+ },
1045
+ required: [
1046
+ "fieldNames",
1047
+ "unique"
1048
+ ]
1049
+ },
1050
+ "AutoBePrisma.IPlainIndex": {
1051
+ 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.",
1052
+ type: "object",
1053
+ properties: {
1054
+ fieldNames: {
1055
+ 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\"]",
1056
+ type: "array",
1057
+ items: {
1058
+ type: "string"
1059
+ },
1060
+ minItems: 1,
1061
+ uniqueItems: true
1062
+ }
1063
+ },
1064
+ required: [
1065
+ "fieldNames"
1066
+ ]
1067
+ },
1068
+ "AutoBePrisma.IGinIndex": {
1069
+ 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.",
1070
+ type: "object",
1071
+ properties: {
1072
+ fieldName: {
1073
+ 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.",
1074
+ type: "string"
1075
+ }
1076
+ },
1077
+ required: [
1078
+ "fieldName"
1079
+ ]
1080
+ }
1081
+ }
1082
+ },
1083
+ description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
1084
+ validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.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.planning || _report(_exceptionable, {
1085
+ path: _path + ".planning",
1086
+ expected: "string",
1087
+ value: input.planning
1088
+ }), (Array.isArray(input.models) || _report(_exceptionable, {
1089
+ path: _path + ".models",
1090
+ expected: "Array<AutoBePrisma.IModel>",
1091
+ value: input.models
1092
+ })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1093
+ path: _path + ".models[" + _index9 + "]",
1094
+ expected: "AutoBePrisma.IModel",
1095
+ value: elem
1096
+ })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1097
+ path: _path + ".models[" + _index9 + "]",
1098
+ expected: "AutoBePrisma.IModel",
1099
+ value: elem
1100
+ })).every(flag => flag) || _report(_exceptionable, {
1101
+ path: _path + ".models",
1102
+ expected: "Array<AutoBePrisma.IModel>",
1103
+ value: input.models
1104
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1105
+ path: _path + ".name",
1106
+ expected: "string & SnakeCasePattern",
1107
+ value: input.name
1108
+ })) || _report(_exceptionable, {
1109
+ path: _path + ".name",
1110
+ expected: "(string & SnakeCasePattern)",
1111
+ value: input.name
1112
+ }), "string" === typeof input.description || _report(_exceptionable, {
1113
+ path: _path + ".description",
1114
+ expected: "string",
1115
+ value: input.description
1116
+ }), "boolean" === typeof input.material || _report(_exceptionable, {
1117
+ path: _path + ".material",
1118
+ expected: "boolean",
1119
+ value: input.material
1120
+ }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
1121
+ path: _path + ".stance",
1122
+ expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
1123
+ value: input.stance
1124
+ }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
1125
+ path: _path + ".primaryField",
1126
+ expected: "AutoBePrisma.IPrimaryField",
1127
+ value: input.primaryField
1128
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1129
+ path: _path + ".primaryField",
1130
+ expected: "AutoBePrisma.IPrimaryField",
1131
+ value: input.primaryField
1132
+ }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
1133
+ path: _path + ".foreignFields",
1134
+ expected: "Array<AutoBePrisma.IForeignField>",
1135
+ value: input.foreignFields
1136
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1137
+ path: _path + ".foreignFields[" + _index10 + "]",
1138
+ expected: "AutoBePrisma.IForeignField",
1139
+ value: elem
1140
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1141
+ path: _path + ".foreignFields[" + _index10 + "]",
1142
+ expected: "AutoBePrisma.IForeignField",
1143
+ value: elem
1144
+ })).every(flag => flag) || _report(_exceptionable, {
1145
+ path: _path + ".foreignFields",
1146
+ expected: "Array<AutoBePrisma.IForeignField>",
1147
+ value: input.foreignFields
1148
+ }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
1149
+ path: _path + ".plainFields",
1150
+ expected: "Array<AutoBePrisma.IPlainField>",
1151
+ value: input.plainFields
1152
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1153
+ path: _path + ".plainFields[" + _index11 + "]",
1154
+ expected: "AutoBePrisma.IPlainField",
1155
+ value: elem
1156
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1157
+ path: _path + ".plainFields[" + _index11 + "]",
1158
+ expected: "AutoBePrisma.IPlainField",
1159
+ value: elem
1160
+ })).every(flag => flag) || _report(_exceptionable, {
1161
+ path: _path + ".plainFields",
1162
+ expected: "Array<AutoBePrisma.IPlainField>",
1163
+ value: input.plainFields
1164
+ }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
1165
+ path: _path + ".uniqueIndexes",
1166
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1167
+ value: input.uniqueIndexes
1168
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1169
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1170
+ expected: "AutoBePrisma.IUniqueIndex",
1171
+ value: elem
1172
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1173
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1174
+ expected: "AutoBePrisma.IUniqueIndex",
1175
+ value: elem
1176
+ })).every(flag => flag) || _report(_exceptionable, {
1177
+ path: _path + ".uniqueIndexes",
1178
+ expected: "Array<AutoBePrisma.IUniqueIndex>",
1179
+ value: input.uniqueIndexes
1180
+ }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
1181
+ path: _path + ".plainIndexes",
1182
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1183
+ value: input.plainIndexes
1184
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1185
+ path: _path + ".plainIndexes[" + _index13 + "]",
1186
+ expected: "AutoBePrisma.IPlainIndex",
1187
+ value: elem
1188
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1189
+ path: _path + ".plainIndexes[" + _index13 + "]",
1190
+ expected: "AutoBePrisma.IPlainIndex",
1191
+ value: elem
1192
+ })).every(flag => flag) || _report(_exceptionable, {
1193
+ path: _path + ".plainIndexes",
1194
+ expected: "Array<AutoBePrisma.IPlainIndex>",
1195
+ value: input.plainIndexes
1196
+ }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
1197
+ path: _path + ".ginIndexes",
1198
+ expected: "Array<AutoBePrisma.IGinIndex>",
1199
+ value: input.ginIndexes
1200
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1201
+ path: _path + ".ginIndexes[" + _index14 + "]",
1202
+ expected: "AutoBePrisma.IGinIndex",
1203
+ value: elem
1204
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1205
+ path: _path + ".ginIndexes[" + _index14 + "]",
1206
+ expected: "AutoBePrisma.IGinIndex",
1207
+ value: elem
1208
+ })).every(flag => flag) || _report(_exceptionable, {
1209
+ path: _path + ".ginIndexes",
1210
+ expected: "Array<AutoBePrisma.IGinIndex>",
1211
+ value: input.ginIndexes
1212
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1213
+ path: _path + ".name",
1214
+ expected: "string & SnakeCasePattern",
1215
+ value: input.name
1216
+ })) || _report(_exceptionable, {
1217
+ path: _path + ".name",
1218
+ expected: "(string & SnakeCasePattern)",
1219
+ value: input.name
1220
+ }), "uuid" === input.type || _report(_exceptionable, {
1221
+ path: _path + ".type",
1222
+ expected: "\"uuid\"",
1223
+ value: input.type
1224
+ }), "string" === typeof input.description || _report(_exceptionable, {
1225
+ path: _path + ".description",
1226
+ expected: "string",
1227
+ value: input.description
1228
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1229
+ path: _path + ".name",
1230
+ expected: "string & SnakeCasePattern",
1231
+ value: input.name
1232
+ })) || _report(_exceptionable, {
1233
+ path: _path + ".name",
1234
+ expected: "(string & SnakeCasePattern)",
1235
+ value: input.name
1236
+ }), "uuid" === input.type || _report(_exceptionable, {
1237
+ path: _path + ".type",
1238
+ expected: "\"uuid\"",
1239
+ value: input.type
1240
+ }), "string" === typeof input.description || _report(_exceptionable, {
1241
+ path: _path + ".description",
1242
+ expected: "string",
1243
+ value: input.description
1244
+ }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
1245
+ path: _path + ".relation",
1246
+ expected: "AutoBePrisma.IRelation",
1247
+ value: input.relation
1248
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1249
+ path: _path + ".relation",
1250
+ expected: "AutoBePrisma.IRelation",
1251
+ value: input.relation
1252
+ }), "boolean" === typeof input.unique || _report(_exceptionable, {
1253
+ path: _path + ".unique",
1254
+ expected: "boolean",
1255
+ value: input.unique
1256
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1257
+ path: _path + ".nullable",
1258
+ expected: "boolean",
1259
+ value: input.nullable
1260
+ })].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, {
1261
+ path: _path + ".name",
1262
+ expected: "string & CamelCasePattern",
1263
+ value: input.name
1264
+ })) || _report(_exceptionable, {
1265
+ path: _path + ".name",
1266
+ expected: "(string & CamelCasePattern)",
1267
+ value: input.name
1268
+ }), "string" === typeof input.targetModel || _report(_exceptionable, {
1269
+ path: _path + ".targetModel",
1270
+ expected: "string",
1271
+ value: input.targetModel
1272
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1273
+ path: _path + ".name",
1274
+ expected: "string & SnakeCasePattern",
1275
+ value: input.name
1276
+ })) || _report(_exceptionable, {
1277
+ path: _path + ".name",
1278
+ expected: "(string & SnakeCasePattern)",
1279
+ value: input.name
1280
+ }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
1281
+ path: _path + ".type",
1282
+ expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
1283
+ value: input.type
1284
+ }), "string" === typeof input.description || _report(_exceptionable, {
1285
+ path: _path + ".description",
1286
+ expected: "string",
1287
+ value: input.description
1288
+ }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1289
+ path: _path + ".nullable",
1290
+ expected: "boolean",
1291
+ value: input.nullable
1292
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1293
+ path: _path + ".fieldNames",
1294
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1295
+ value: input.fieldNames
1296
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1297
+ path: _path + ".fieldNames",
1298
+ expected: "Array<> & MinItems<1>",
1299
+ value: input.fieldNames
1300
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1301
+ path: _path + ".fieldNames",
1302
+ expected: "Array<> & UniqueItems<true>",
1303
+ value: input.fieldNames
1304
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1305
+ path: _path + ".fieldNames[" + _index15 + "]",
1306
+ expected: "string",
1307
+ value: elem
1308
+ })).every(flag => flag)) || _report(_exceptionable, {
1309
+ path: _path + ".fieldNames",
1310
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1311
+ value: input.fieldNames
1312
+ }), true === input.unique || _report(_exceptionable, {
1313
+ path: _path + ".unique",
1314
+ expected: "true",
1315
+ value: input.unique
1316
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1317
+ path: _path + ".fieldNames",
1318
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1319
+ value: input.fieldNames
1320
+ })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1321
+ path: _path + ".fieldNames",
1322
+ expected: "Array<> & MinItems<1>",
1323
+ value: input.fieldNames
1324
+ })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1325
+ path: _path + ".fieldNames",
1326
+ expected: "Array<> & UniqueItems<true>",
1327
+ value: input.fieldNames
1328
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1329
+ path: _path + ".fieldNames[" + _index16 + "]",
1330
+ expected: "string",
1331
+ value: elem
1332
+ })).every(flag => flag)) || _report(_exceptionable, {
1333
+ path: _path + ".fieldNames",
1334
+ expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1335
+ value: input.fieldNames
1336
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1337
+ path: _path + ".fieldName",
1338
+ expected: "string",
1339
+ value: input.fieldName
1340
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
1341
+ if (false === __is(input)) {
1342
+ errors = [];
1343
+ _report = __typia_transform__validateReport._validateReport(errors);
1344
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1345
+ path: _path + "",
1346
+ expected: "IAutoBePrismaCorrectApplication.IProps",
1347
+ value: input
1348
+ })) && _vo0(input, _path + "", true) || _report(true, {
1349
+ path: _path + "",
1350
+ expected: "IAutoBePrismaCorrectApplication.IProps",
1351
+ value: input
1352
+ }))(input, "$input", true);
1353
+ const success = 0 === errors.length;
1354
+ return success ? {
1355
+ success,
1356
+ data: input
1357
+ } : {
1358
+ success,
1359
+ errors,
1360
+ data: input
1361
+ };
1362
+ }
1363
+ return {
1364
+ success: true,
1365
+ data: input
1366
+ };
1367
+ }; })()
1368
+ }
1369
+ ]
1370
+ },
1371
+ gemini: {
1372
+ model: "gemini",
1373
+ options: {
1374
+ reference: true,
796
1375
  separate: null
797
1376
  },
798
1377
  functions: [
@@ -821,7 +1400,7 @@ const collection = {
821
1400
  additionalProperties: false,
822
1401
  $defs: {
823
1402
  "AutoBePrisma.IModel": {
824
- 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.",
1403
+ 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_)",
825
1404
  type: "object",
826
1405
  properties: {
827
1406
  name: {
@@ -846,6 +1425,7 @@ const collection = {
846
1425
  ]
847
1426
  },
848
1427
  primaryField: {
1428
+ 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.",
849
1429
  $ref: "#/$defs/AutoBePrisma.IPrimaryField"
850
1430
  },
851
1431
  foreignFields: {
@@ -924,7 +1504,7 @@ const collection = {
924
1504
  ]
925
1505
  },
926
1506
  "AutoBePrisma.IForeignField": {
927
- 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.",
1507
+ 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.",
928
1508
  type: "object",
929
1509
  properties: {
930
1510
  name: {
@@ -943,6 +1523,7 @@ const collection = {
943
1523
  type: "string"
944
1524
  },
945
1525
  relation: {
1526
+ 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.",
946
1527
  $ref: "#/$defs/AutoBePrisma.IRelation"
947
1528
  },
948
1529
  unique: {
@@ -1361,9 +1942,5 @@ const collection = {
1361
1942
  }
1362
1943
  ]
1363
1944
  },
1364
- claude,
1365
- llama: claude,
1366
- deepseek: claude,
1367
- "3.1": claude,
1368
1945
  };
1369
1946
  //# sourceMappingURL=orchestratePrismaCorrect.js.map