@autobe/agent 0.5.1 → 0.5.2

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.
@@ -53,6 +53,15 @@ const typia_1 = __importDefault(require("typia"));
53
53
  const assertSchemaModel_1 = require("../../context/assertSchemaModel");
54
54
  const transformPrismaCorrectHistories_1 = require("./transformPrismaCorrectHistories");
55
55
  function orchestratePrismaCorrect(ctx, application, retry = 8) {
56
+ const unique = new Set();
57
+ for (const file of application.files)
58
+ file.models = file.models.filter((model) => {
59
+ if (unique.has(model.name))
60
+ return false;
61
+ unique.add(model.name);
62
+ return true;
63
+ });
64
+ application.files = application.files.filter((f) => f.models.length !== 0);
56
65
  return step(ctx, application, retry);
57
66
  }
58
67
  function step(ctx, application, life) {
@@ -102,18 +111,26 @@ function step(ctx, application, life) {
102
111
  console.error("Unreachable error: PrismaCompilerAgent.pointer.value is null");
103
112
  return result; // unreachable
104
113
  }
114
+ const correction = {
115
+ files: application.files.map((file) => ({
116
+ filename: file.filename,
117
+ namespace: file.namespace,
118
+ models: file.models.map((model) => {
119
+ const newbie = pointer.value.models.find((m) => m.name === model.name);
120
+ return newbie !== null && newbie !== void 0 ? newbie : model;
121
+ }),
122
+ })),
123
+ };
105
124
  ctx.dispatch({
106
125
  type: "prismaCorrect",
107
126
  failure: result,
108
- correction: {
109
- files: pointer.value.files,
110
- },
127
+ correction,
111
128
  planning: pointer.value.planning,
112
129
  step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
113
130
  created_at: new Date().toISOString(),
114
131
  });
115
132
  return step(ctx, {
116
- files: pointer.value.files,
133
+ files: correction.files,
117
134
  }, life - 1);
118
135
  });
119
136
  }
@@ -145,356 +162,300 @@ const claude = {
145
162
  type: "object",
146
163
  properties: {
147
164
  planning: {
148
- title: "Detailed execution plan for fixing AutoBePrisma validation errors",
149
- description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints",
165
+ 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, 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",
150
166
  type: "string"
151
167
  },
152
- files: {
153
- description: "Original AutoBePrisma.IApplication structure that contains validation\nerrors and needs correction.\n\n\uD83D\uDCE5 Input Structure:\n\n- Complete IApplication with files array containing validation errors\n- Each file contains models with potential structural issues\n- Errors may include duplications, invalid references, or constraint\n violations\n\n\uD83D\uDD0D Expected Validation Issues:\n\n- Duplicate model names across files\n- Duplicate field/relation names within models\n- Invalid foreign key references to non-existent models\n- Single foreign key fields in index arrays\n- Non-plural model names or invalid naming conventions\n\n\uD83D\uDCDD Application Content Analysis:\n\n- All models with their complete field definitions\n- All relationships with targetModel and targetfield configurations\n- All indexes (unique, plain, GIN) with field references\n- All business descriptions and requirement mappings\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Processing Notes:\n\n- Structure may contain validation errors that prevent code generation\n- Some models might reference non-existent targets\n- Field names might violate naming conventions\n- Index configurations might include forbidden single foreign keys\n- Business logic and descriptions must be preserved during fixes",
168
+ models: {
169
+ 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",
154
170
  type: "array",
155
171
  items: {
156
- description: "Description of the current {@link AutoBePrisma.IFile} type:\n\n> Interface representing a single Prisma schema file within the application.\n> \n> Each file focuses on a specific business domain and contains related\n> models. File organization follows domain-driven design principles as seen\n> in the uploaded schemas.",
172
+ description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
157
173
  type: "object",
158
174
  properties: {
159
- filename: {
160
- title: "Name of the schema file to be generated",
161
- description: "Name of the schema file to be generated.\n\nShould follow the naming convention: \"schema-{number}-{domain}.prisma\"\nExamples: \"schema-02-systematic.prisma\", \"schema-03-actors.prisma\" The\nnumber indicates the dependency order for schema generation.",
175
+ name: {
176
+ title: "Name of the Prisma model (database table name)",
177
+ description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"",
162
178
  type: "string",
163
- pattern: "^[a-zA-Z0-9._-]+\\.prisma$"
179
+ pattern: "^[a-z][a-z0-9_]*$"
164
180
  },
165
- namespace: {
166
- title: "Business domain namespace that groups related models",
167
- description: "Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as \"@\\namespace directive\".\nExamples from uploaded schemas: \"Systematic\", \"Actors\", \"Sales\", \"Carts\",\n\"Orders\", \"Coupons\", \"Coins\", \"Inquiries\", \"Favorites\", \"Articles\"",
181
+ description: {
182
+ 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 Example:\n \"Customer information, but not a person but a **connection** basis...\"",
168
183
  type: "string"
169
184
  },
170
- models: {
171
- title: "Array of Prisma models (database tables) within this domain",
172
- description: "Array of Prisma models (database tables) within this domain.\n\nEach model represents a business entity or concept within the namespace.\nModels can reference each other through foreign key relationships.",
185
+ material: {
186
+ 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",
187
+ type: "boolean"
188
+ },
189
+ primaryField: {
190
+ 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
191
+ type: "object",
192
+ properties: {
193
+ name: {
194
+ title: "Name of the primary key field",
195
+ description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.",
196
+ type: "string",
197
+ pattern: "^[a-z][a-z0-9_]*$"
198
+ },
199
+ type: {
200
+ title: "Data type of the primary key field",
201
+ 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.",
202
+ "const": "uuid"
203
+ },
204
+ description: {
205
+ title: "Description of the primary key field's purpose",
206
+ 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.",
207
+ type: "string"
208
+ }
209
+ },
210
+ required: [
211
+ "name",
212
+ "type",
213
+ "description"
214
+ ]
215
+ },
216
+ foreignFields: {
217
+ title: "Array of foreign key fields that reference other models",
218
+ 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.",
173
219
  type: "array",
174
220
  items: {
175
- description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
221
+ description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
176
222
  type: "object",
177
223
  properties: {
178
224
  name: {
179
- title: "Name of the Prisma model (database table name)",
180
- description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"",
225
+ title: "Name of the foreign key field",
226
+ description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)",
181
227
  type: "string",
182
228
  pattern: "^[a-z][a-z0-9_]*$"
183
229
  },
230
+ type: {
231
+ title: "Data type of the foreign key field",
232
+ 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.",
233
+ "const": "uuid"
234
+ },
184
235
  description: {
185
- 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 Example:\n \"Customer information, but not a person but a **connection** basis...\"",
236
+ 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.",
186
237
  type: "string"
187
238
  },
188
- material: {
189
- 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",
190
- type: "boolean"
191
- },
192
- primaryField: {
193
- 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
239
+ relation: {
240
+ title: "Prisma relation configuration defining the association details",
241
+ 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.",
194
242
  type: "object",
195
243
  properties: {
196
244
  name: {
197
- title: "Name of the primary key field",
198
- description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.",
245
+ title: "Name of the relation property in the Prisma model",
246
+ description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"",
199
247
  type: "string",
200
- pattern: "^[a-z][a-z0-9_]*$"
201
- },
202
- type: {
203
- title: "Data type of the primary key field",
204
- 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.",
205
- "const": "uuid"
248
+ pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
206
249
  },
207
- description: {
208
- title: "Description of the primary key field's purpose",
209
- 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.",
250
+ targetModel: {
251
+ title: "Name of the target model being referenced",
252
+ description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
210
253
  type: "string"
211
254
  }
212
255
  },
213
256
  required: [
214
257
  "name",
215
- "type",
216
- "description"
258
+ "targetModel"
217
259
  ]
218
260
  },
219
- foreignFields: {
220
- title: "Array of foreign key fields that reference other models",
221
- 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.",
222
- type: "array",
223
- items: {
224
- description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
225
- type: "object",
226
- properties: {
227
- name: {
228
- title: "Name of the foreign key field",
229
- description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)",
230
- type: "string",
231
- pattern: "^[a-z][a-z0-9_]*$"
232
- },
233
- type: {
234
- title: "Data type of the foreign key field",
235
- 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.",
236
- "const": "uuid"
237
- },
238
- description: {
239
- 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.",
240
- type: "string"
241
- },
242
- relation: {
243
- title: "Prisma relation configuration defining the association details",
244
- 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.",
245
- type: "object",
246
- properties: {
247
- name: {
248
- title: "Name of the relation property in the Prisma model",
249
- description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"",
250
- type: "string",
251
- pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
252
- },
253
- targetModel: {
254
- title: "Name of the target model being referenced",
255
- description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
256
- type: "string"
257
- }
258
- },
259
- required: [
260
- "name",
261
- "targetModel"
262
- ]
263
- },
264
- unique: {
265
- title: "Whether this foreign key has a unique constraint",
266
- 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.",
267
- type: "boolean"
268
- },
269
- nullable: {
270
- title: "Whether this foreign key can be null (optional relationship)",
271
- 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.",
272
- type: "boolean"
273
- }
274
- },
275
- required: [
276
- "name",
277
- "type",
278
- "description",
279
- "relation",
280
- "unique",
281
- "nullable"
282
- ]
283
- }
261
+ unique: {
262
+ title: "Whether this foreign key has a unique constraint",
263
+ 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.",
264
+ type: "boolean"
284
265
  },
285
- plainFields: {
286
- title: "Array of regular data fields that don't reference other models",
287
- 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.",
288
- type: "array",
289
- items: {
290
- description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
291
- type: "object",
292
- properties: {
293
- name: {
294
- title: "Name of the field in the database table",
295
- description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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",
296
- type: "string",
297
- pattern: "^[a-z][a-z0-9_]*$"
298
- },
299
- type: {
300
- title: "Data type of the field for Prisma schema generation",
301
- 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
302
- oneOf: [
303
- {
304
- "const": "string"
305
- },
306
- {
307
- "const": "boolean"
308
- },
309
- {
310
- "const": "uuid"
311
- },
312
- {
313
- "const": "uri"
314
- },
315
- {
316
- "const": "int"
317
- },
318
- {
319
- "const": "double"
320
- },
321
- {
322
- "const": "datetime"
323
- }
324
- ]
325
- },
326
- description: {
327
- title: "Description explaining the business purpose and usage of this field",
328
- 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
329
- type: "string"
330
- },
331
- nullable: {
332
- title: "Whether this field can contain null values",
333
- 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.",
334
- type: "boolean"
335
- }
336
- },
337
- required: [
338
- "name",
339
- "type",
340
- "description",
341
- "nullable"
342
- ]
343
- }
266
+ nullable: {
267
+ title: "Whether this foreign key can be null (optional relationship)",
268
+ 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.",
269
+ type: "boolean"
270
+ }
271
+ },
272
+ required: [
273
+ "name",
274
+ "type",
275
+ "description",
276
+ "relation",
277
+ "unique",
278
+ "nullable"
279
+ ]
280
+ }
281
+ },
282
+ plainFields: {
283
+ title: "Array of regular data fields that don't reference other models",
284
+ 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.",
285
+ type: "array",
286
+ items: {
287
+ description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
288
+ type: "object",
289
+ properties: {
290
+ name: {
291
+ title: "Name of the field in the database table",
292
+ description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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",
293
+ type: "string",
294
+ pattern: "^[a-z][a-z0-9_]*$"
344
295
  },
345
- uniqueIndexes: {
346
- title: "Array of unique indexes for enforcing data integrity constraints",
347
- 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).",
348
- type: "array",
349
- items: {
350
- description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
351
- type: "object",
352
- properties: {
353
- fieldNames: {
354
- title: "Array of field names that together form the unique constraint",
355
- 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\"]",
356
- type: "array",
357
- items: {
358
- type: "string"
359
- },
360
- minItems: 1,
361
- uniqueItems: true
362
- },
363
- unique: {
364
- title: "Explicit marker indicating this is a unique index",
365
- 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\".",
366
- "const": true
367
- }
296
+ type: {
297
+ title: "Data type of the field for Prisma schema generation",
298
+ 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
299
+ oneOf: [
300
+ {
301
+ "const": "string"
368
302
  },
369
- required: [
370
- "fieldNames",
371
- "unique"
372
- ]
373
- }
303
+ {
304
+ "const": "boolean"
305
+ },
306
+ {
307
+ "const": "uuid"
308
+ },
309
+ {
310
+ "const": "uri"
311
+ },
312
+ {
313
+ "const": "int"
314
+ },
315
+ {
316
+ "const": "double"
317
+ },
318
+ {
319
+ "const": "datetime"
320
+ }
321
+ ]
374
322
  },
375
- plainIndexes: {
376
- title: "Array of regular indexes for query performance optimization",
377
- 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.",
323
+ description: {
324
+ title: "Description explaining the business purpose and usage of this field",
325
+ 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
326
+ type: "string"
327
+ },
328
+ nullable: {
329
+ title: "Whether this field can contain null values",
330
+ 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.",
331
+ type: "boolean"
332
+ }
333
+ },
334
+ required: [
335
+ "name",
336
+ "type",
337
+ "description",
338
+ "nullable"
339
+ ]
340
+ }
341
+ },
342
+ uniqueIndexes: {
343
+ title: "Array of unique indexes for enforcing data integrity constraints",
344
+ 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).",
345
+ type: "array",
346
+ items: {
347
+ description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
348
+ type: "object",
349
+ properties: {
350
+ fieldNames: {
351
+ title: "Array of field names that together form the unique constraint",
352
+ 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\"]",
378
353
  type: "array",
379
354
  items: {
380
- description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
381
- type: "object",
382
- properties: {
383
- fieldNames: {
384
- title: "Array of field names to include in the performance index",
385
- 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\"]",
386
- type: "array",
387
- items: {
388
- type: "string"
389
- },
390
- minItems: 1,
391
- uniqueItems: true
392
- }
393
- },
394
- required: [
395
- "fieldNames"
396
- ]
397
- }
355
+ type: "string"
356
+ },
357
+ minItems: 1,
358
+ uniqueItems: true
398
359
  },
399
- ginIndexes: {
400
- title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
401
- 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.",
360
+ unique: {
361
+ title: "Explicit marker indicating this is a unique index",
362
+ 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\".",
363
+ "const": true
364
+ }
365
+ },
366
+ required: [
367
+ "fieldNames",
368
+ "unique"
369
+ ]
370
+ }
371
+ },
372
+ plainIndexes: {
373
+ title: "Array of regular indexes for query performance optimization",
374
+ 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.",
375
+ type: "array",
376
+ items: {
377
+ description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
378
+ type: "object",
379
+ properties: {
380
+ fieldNames: {
381
+ title: "Array of field names to include in the performance index",
382
+ 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\"]",
402
383
  type: "array",
403
384
  items: {
404
- description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
405
- type: "object",
406
- properties: {
407
- fieldName: {
408
- title: "Name of the text field to index for full-text search capabilities",
409
- 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.",
410
- type: "string"
411
- }
412
- },
413
- required: [
414
- "fieldName"
415
- ]
416
- }
385
+ type: "string"
386
+ },
387
+ minItems: 1,
388
+ uniqueItems: true
417
389
  }
418
390
  },
419
391
  required: [
420
- "name",
421
- "description",
422
- "material",
423
- "primaryField",
424
- "foreignFields",
425
- "plainFields",
426
- "uniqueIndexes",
427
- "plainIndexes",
428
- "ginIndexes"
392
+ "fieldNames"
393
+ ]
394
+ }
395
+ },
396
+ ginIndexes: {
397
+ title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
398
+ 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.",
399
+ type: "array",
400
+ items: {
401
+ description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
402
+ type: "object",
403
+ properties: {
404
+ fieldName: {
405
+ title: "Name of the text field to index for full-text search capabilities",
406
+ 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.",
407
+ type: "string"
408
+ }
409
+ },
410
+ required: [
411
+ "fieldName"
429
412
  ]
430
413
  }
431
414
  }
432
415
  },
433
416
  required: [
434
- "filename",
435
- "namespace",
436
- "models"
417
+ "name",
418
+ "description",
419
+ "material",
420
+ "primaryField",
421
+ "foreignFields",
422
+ "plainFields",
423
+ "uniqueIndexes",
424
+ "plainIndexes",
425
+ "ginIndexes"
437
426
  ]
438
427
  }
439
428
  }
440
429
  },
441
430
  required: [
442
431
  "planning",
443
- "files"
432
+ "models"
444
433
  ],
445
434
  additionalProperties: false,
446
435
  $defs: {}
447
436
  },
448
- description: "Fixes validation errors in AutoBePrisma.IApplication structure while\npreserving ALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors - never remove business descriptions\n2. Apply minimal changes - preserve original design intent\n3. Return COMPLETE corrected structure - no data loss allowed\n4. Maintain referential integrity across all models\n\n## Preservation Requirements\n\n- Keep ALL model and field descriptions\n- Keep business logic and architectural patterns\n- Maintain relationship semantics and cardinality\n- Remove descriptions only when removing duplicate elements\n\n## Fix Strategy\n\n- Resolve structural validation errors without changing business intent\n- Remove duplicate fields/relations while preserving most appropriate ones\n- Fix invalid references and type mismatches\n- Ensure naming conventions and index rules compliance",
449
- validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.filename && RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) && "string" === typeof input.namespace && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io3(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io9(elem))); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io4 = 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 && _io5(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io5 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel; const _io6 = 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 _io7 = 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 _io8 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io9 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
437
+ 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",
438
+ 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 && ("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-zA-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, {
450
439
  path: _path + ".planning",
451
440
  expected: "string",
452
441
  value: input.planning
453
- }), (Array.isArray(input.files) || _report(_exceptionable, {
454
- path: _path + ".files",
455
- expected: "Array<AutoBePrisma.IFile>",
456
- value: input.files
457
- })) && input.files.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
458
- path: _path + ".files[" + _index10 + "]",
459
- expected: "AutoBePrisma.IFile",
460
- value: elem
461
- })) && _vo1(elem, _path + ".files[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
462
- path: _path + ".files[" + _index10 + "]",
463
- expected: "AutoBePrisma.IFile",
464
- value: elem
465
- })).every(flag => flag) || _report(_exceptionable, {
466
- path: _path + ".files",
467
- expected: "Array<AutoBePrisma.IFile>",
468
- value: input.files
469
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
470
- path: _path + ".filename",
471
- expected: "string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">",
472
- value: input.filename
473
- })) || _report(_exceptionable, {
474
- path: _path + ".filename",
475
- expected: "(string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">)",
476
- value: input.filename
477
- }), "string" === typeof input.namespace || _report(_exceptionable, {
478
- path: _path + ".namespace",
479
- expected: "string",
480
- value: input.namespace
481
442
  }), (Array.isArray(input.models) || _report(_exceptionable, {
482
443
  path: _path + ".models",
483
444
  expected: "Array<AutoBePrisma.IModel>",
484
445
  value: input.models
485
- })) && input.models.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
486
- path: _path + ".models[" + _index11 + "]",
446
+ })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
447
+ path: _path + ".models[" + _index9 + "]",
487
448
  expected: "AutoBePrisma.IModel",
488
449
  value: elem
489
- })) && _vo2(elem, _path + ".models[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
490
- path: _path + ".models[" + _index11 + "]",
450
+ })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
451
+ path: _path + ".models[" + _index9 + "]",
491
452
  expected: "AutoBePrisma.IModel",
492
453
  value: elem
493
454
  })).every(flag => flag) || _report(_exceptionable, {
494
455
  path: _path + ".models",
495
456
  expected: "Array<AutoBePrisma.IModel>",
496
457
  value: input.models
497
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
458
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
498
459
  path: _path + ".name",
499
460
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
500
461
  value: input.name
@@ -514,7 +475,7 @@ const claude = {
514
475
  path: _path + ".primaryField",
515
476
  expected: "AutoBePrisma.IPrimaryField",
516
477
  value: input.primaryField
517
- })) && _vo3(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
478
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
518
479
  path: _path + ".primaryField",
519
480
  expected: "AutoBePrisma.IPrimaryField",
520
481
  value: input.primaryField
@@ -522,12 +483,12 @@ const claude = {
522
483
  path: _path + ".foreignFields",
523
484
  expected: "Array<AutoBePrisma.IForeignField>",
524
485
  value: input.foreignFields
525
- })) && input.foreignFields.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
526
- path: _path + ".foreignFields[" + _index12 + "]",
486
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
487
+ path: _path + ".foreignFields[" + _index10 + "]",
527
488
  expected: "AutoBePrisma.IForeignField",
528
489
  value: elem
529
- })) && _vo4(elem, _path + ".foreignFields[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
530
- path: _path + ".foreignFields[" + _index12 + "]",
490
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
491
+ path: _path + ".foreignFields[" + _index10 + "]",
531
492
  expected: "AutoBePrisma.IForeignField",
532
493
  value: elem
533
494
  })).every(flag => flag) || _report(_exceptionable, {
@@ -538,12 +499,12 @@ const claude = {
538
499
  path: _path + ".plainFields",
539
500
  expected: "Array<AutoBePrisma.IPlainField>",
540
501
  value: input.plainFields
541
- })) && input.plainFields.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
542
- path: _path + ".plainFields[" + _index13 + "]",
502
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
503
+ path: _path + ".plainFields[" + _index11 + "]",
543
504
  expected: "AutoBePrisma.IPlainField",
544
505
  value: elem
545
- })) && _vo6(elem, _path + ".plainFields[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
546
- path: _path + ".plainFields[" + _index13 + "]",
506
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
507
+ path: _path + ".plainFields[" + _index11 + "]",
547
508
  expected: "AutoBePrisma.IPlainField",
548
509
  value: elem
549
510
  })).every(flag => flag) || _report(_exceptionable, {
@@ -554,12 +515,12 @@ const claude = {
554
515
  path: _path + ".uniqueIndexes",
555
516
  expected: "Array<AutoBePrisma.IUniqueIndex>",
556
517
  value: input.uniqueIndexes
557
- })) && input.uniqueIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
558
- path: _path + ".uniqueIndexes[" + _index14 + "]",
518
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
519
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
559
520
  expected: "AutoBePrisma.IUniqueIndex",
560
521
  value: elem
561
- })) && _vo7(elem, _path + ".uniqueIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
562
- path: _path + ".uniqueIndexes[" + _index14 + "]",
522
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
523
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
563
524
  expected: "AutoBePrisma.IUniqueIndex",
564
525
  value: elem
565
526
  })).every(flag => flag) || _report(_exceptionable, {
@@ -570,12 +531,12 @@ const claude = {
570
531
  path: _path + ".plainIndexes",
571
532
  expected: "Array<AutoBePrisma.IPlainIndex>",
572
533
  value: input.plainIndexes
573
- })) && input.plainIndexes.map((elem, _index15) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
574
- path: _path + ".plainIndexes[" + _index15 + "]",
534
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
535
+ path: _path + ".plainIndexes[" + _index13 + "]",
575
536
  expected: "AutoBePrisma.IPlainIndex",
576
537
  value: elem
577
- })) && _vo8(elem, _path + ".plainIndexes[" + _index15 + "]", true && _exceptionable) || _report(_exceptionable, {
578
- path: _path + ".plainIndexes[" + _index15 + "]",
538
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
539
+ path: _path + ".plainIndexes[" + _index13 + "]",
579
540
  expected: "AutoBePrisma.IPlainIndex",
580
541
  value: elem
581
542
  })).every(flag => flag) || _report(_exceptionable, {
@@ -586,19 +547,19 @@ const claude = {
586
547
  path: _path + ".ginIndexes",
587
548
  expected: "Array<AutoBePrisma.IGinIndex>",
588
549
  value: input.ginIndexes
589
- })) && input.ginIndexes.map((elem, _index16) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
590
- path: _path + ".ginIndexes[" + _index16 + "]",
550
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
551
+ path: _path + ".ginIndexes[" + _index14 + "]",
591
552
  expected: "AutoBePrisma.IGinIndex",
592
553
  value: elem
593
- })) && _vo9(elem, _path + ".ginIndexes[" + _index16 + "]", true && _exceptionable) || _report(_exceptionable, {
594
- path: _path + ".ginIndexes[" + _index16 + "]",
554
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
555
+ path: _path + ".ginIndexes[" + _index14 + "]",
595
556
  expected: "AutoBePrisma.IGinIndex",
596
557
  value: elem
597
558
  })).every(flag => flag) || _report(_exceptionable, {
598
559
  path: _path + ".ginIndexes",
599
560
  expected: "Array<AutoBePrisma.IGinIndex>",
600
561
  value: input.ginIndexes
601
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
562
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
602
563
  path: _path + ".name",
603
564
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
604
565
  value: input.name
@@ -614,7 +575,7 @@ const claude = {
614
575
  path: _path + ".description",
615
576
  expected: "string",
616
577
  value: input.description
617
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
578
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
618
579
  path: _path + ".name",
619
580
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
620
581
  value: input.name
@@ -634,7 +595,7 @@ const claude = {
634
595
  path: _path + ".relation",
635
596
  expected: "__type",
636
597
  value: input.relation
637
- })) && _vo5(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
598
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
638
599
  path: _path + ".relation",
639
600
  expected: "__type",
640
601
  value: input.relation
@@ -646,7 +607,7 @@ const claude = {
646
607
  path: _path + ".nullable",
647
608
  expected: "boolean",
648
609
  value: input.nullable
649
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
610
+ })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
650
611
  path: _path + ".name",
651
612
  expected: "string & Pattern<\"^[a-zA-Z_][a-zA-Z0-9_]*$\">",
652
613
  value: input.name
@@ -658,7 +619,7 @@ const claude = {
658
619
  path: _path + ".targetModel",
659
620
  expected: "string",
660
621
  value: input.targetModel
661
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
622
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
662
623
  path: _path + ".name",
663
624
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
664
625
  value: input.name
@@ -678,7 +639,7 @@ const claude = {
678
639
  path: _path + ".nullable",
679
640
  expected: "boolean",
680
641
  value: input.nullable
681
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
642
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
682
643
  path: _path + ".fieldNames",
683
644
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
684
645
  value: input.fieldNames
@@ -690,8 +651,8 @@ const claude = {
690
651
  path: _path + ".fieldNames",
691
652
  expected: "Array<> & UniqueItems<true>",
692
653
  value: input.fieldNames
693
- })) && input.fieldNames.map((elem, _index17) => "string" === typeof elem || _report(_exceptionable, {
694
- path: _path + ".fieldNames[" + _index17 + "]",
654
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
655
+ path: _path + ".fieldNames[" + _index15 + "]",
695
656
  expected: "string",
696
657
  value: elem
697
658
  })).every(flag => flag)) || _report(_exceptionable, {
@@ -702,7 +663,7 @@ const claude = {
702
663
  path: _path + ".unique",
703
664
  expected: "true",
704
665
  value: input.unique
705
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
666
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
706
667
  path: _path + ".fieldNames",
707
668
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
708
669
  value: input.fieldNames
@@ -714,15 +675,15 @@ const claude = {
714
675
  path: _path + ".fieldNames",
715
676
  expected: "Array<> & UniqueItems<true>",
716
677
  value: input.fieldNames
717
- })) && input.fieldNames.map((elem, _index18) => "string" === typeof elem || _report(_exceptionable, {
718
- path: _path + ".fieldNames[" + _index18 + "]",
678
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
679
+ path: _path + ".fieldNames[" + _index16 + "]",
719
680
  expected: "string",
720
681
  value: elem
721
682
  })).every(flag => flag)) || _report(_exceptionable, {
722
683
  path: _path + ".fieldNames",
723
684
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
724
685
  value: input.fieldNames
725
- })].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
686
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
726
687
  path: _path + ".fieldName",
727
688
  expected: "string",
728
689
  value: input.fieldName
@@ -773,342 +734,287 @@ const collection = {
773
734
  type: "object",
774
735
  properties: {
775
736
  planning: {
776
- title: "Detailed execution plan for fixing AutoBePrisma validation errors",
777
- description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints",
737
+ 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, 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",
778
738
  type: "string"
779
739
  },
780
- files: {
781
- description: "Original AutoBePrisma.IApplication structure that contains validation\nerrors and needs correction.\n\n\uD83D\uDCE5 Input Structure:\n\n- Complete IApplication with files array containing validation errors\n- Each file contains models with potential structural issues\n- Errors may include duplications, invalid references, or constraint\n violations\n\n\uD83D\uDD0D Expected Validation Issues:\n\n- Duplicate model names across files\n- Duplicate field/relation names within models\n- Invalid foreign key references to non-existent models\n- Single foreign key fields in index arrays\n- Non-plural model names or invalid naming conventions\n\n\uD83D\uDCDD Application Content Analysis:\n\n- All models with their complete field definitions\n- All relationships with targetModel and targetfield configurations\n- All indexes (unique, plain, GIN) with field references\n- All business descriptions and requirement mappings\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Processing Notes:\n\n- Structure may contain validation errors that prevent code generation\n- Some models might reference non-existent targets\n- Field names might violate naming conventions\n- Index configurations might include forbidden single foreign keys\n- Business logic and descriptions must be preserved during fixes",
740
+ models: {
741
+ 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",
782
742
  type: "array",
783
743
  items: {
784
- description: "Description of the current {@link AutoBePrisma.IFile} type:\n\n> Interface representing a single Prisma schema file within the application.\n> \n> Each file focuses on a specific business domain and contains related\n> models. File organization follows domain-driven design principles as seen\n> in the uploaded schemas.",
744
+ description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
785
745
  type: "object",
786
746
  properties: {
787
- filename: {
788
- title: "Name of the schema file to be generated",
789
- description: "Name of the schema file to be generated.\n\nShould follow the naming convention: \"schema-{number}-{domain}.prisma\"\nExamples: \"schema-02-systematic.prisma\", \"schema-03-actors.prisma\" The\nnumber indicates the dependency order for schema generation.\n\n\n@pattern ^[a-zA-Z0-9._-]+\\.prisma$",
747
+ name: {
748
+ title: "Name of the Prisma model (database table name)",
749
+ description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"\n\n\n@pattern ^[a-z][a-z0-9_]*$",
790
750
  type: "string"
791
751
  },
792
- namespace: {
793
- title: "Business domain namespace that groups related models",
794
- description: "Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as \"@\\namespace directive\".\nExamples from uploaded schemas: \"Systematic\", \"Actors\", \"Sales\", \"Carts\",\n\"Orders\", \"Coupons\", \"Coins\", \"Inquiries\", \"Favorites\", \"Articles\"",
752
+ description: {
753
+ 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 Example:\n \"Customer information, but not a person but a **connection** basis...\"",
795
754
  type: "string"
796
755
  },
797
- models: {
798
- title: "Array of Prisma models (database tables) within this domain",
799
- description: "Array of Prisma models (database tables) within this domain.\n\nEach model represents a business entity or concept within the namespace.\nModels can reference each other through foreign key relationships.",
756
+ material: {
757
+ 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",
758
+ type: "boolean"
759
+ },
760
+ primaryField: {
761
+ 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
762
+ type: "object",
763
+ properties: {
764
+ name: {
765
+ title: "Name of the primary key field",
766
+ description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.\n\n\n@pattern ^[a-z][a-z0-9_]*$",
767
+ type: "string"
768
+ },
769
+ type: {
770
+ title: "Data type of the primary key field",
771
+ 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.",
772
+ type: "string",
773
+ "enum": [
774
+ "uuid"
775
+ ]
776
+ },
777
+ description: {
778
+ title: "Description of the primary key field's purpose",
779
+ 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.",
780
+ type: "string"
781
+ }
782
+ },
783
+ required: [
784
+ "name",
785
+ "type",
786
+ "description"
787
+ ]
788
+ },
789
+ foreignFields: {
790
+ title: "Array of foreign key fields that reference other models",
791
+ 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.",
800
792
  type: "array",
801
793
  items: {
802
- description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
794
+ description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
803
795
  type: "object",
804
796
  properties: {
805
797
  name: {
806
- title: "Name of the Prisma model (database table name)",
807
- description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"\n\n\n@pattern ^[a-z][a-z0-9_]*$",
798
+ title: "Name of the foreign key field",
799
+ description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$",
808
800
  type: "string"
809
801
  },
802
+ type: {
803
+ title: "Data type of the foreign key field",
804
+ 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.",
805
+ type: "string",
806
+ "enum": [
807
+ "uuid"
808
+ ]
809
+ },
810
810
  description: {
811
- 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 Example:\n \"Customer information, but not a person but a **connection** basis...\"",
811
+ 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.",
812
812
  type: "string"
813
813
  },
814
- material: {
815
- 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",
816
- type: "boolean"
817
- },
818
- primaryField: {
819
- 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
814
+ relation: {
815
+ title: "Prisma relation configuration defining the association details",
816
+ 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.",
820
817
  type: "object",
821
818
  properties: {
822
819
  name: {
823
- title: "Name of the primary key field",
824
- description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.\n\n\n@pattern ^[a-z][a-z0-9_]*$",
820
+ title: "Name of the relation property in the Prisma model",
821
+ description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"\n\n\n@pattern ^[a-zA-Z_][a-zA-Z0-9_]*$",
825
822
  type: "string"
826
823
  },
827
- type: {
828
- title: "Data type of the primary key field",
829
- 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.",
830
- type: "string",
831
- "enum": [
832
- "uuid"
833
- ]
834
- },
835
- description: {
836
- title: "Description of the primary key field's purpose",
837
- 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.",
824
+ targetModel: {
825
+ title: "Name of the target model being referenced",
826
+ description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
838
827
  type: "string"
839
828
  }
840
829
  },
841
830
  required: [
842
831
  "name",
843
- "type",
844
- "description"
832
+ "targetModel"
845
833
  ]
846
834
  },
847
- foreignFields: {
848
- title: "Array of foreign key fields that reference other models",
849
- 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.",
850
- type: "array",
851
- items: {
852
- description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
853
- type: "object",
854
- properties: {
855
- name: {
856
- title: "Name of the foreign key field",
857
- description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$",
858
- type: "string"
859
- },
860
- type: {
861
- title: "Data type of the foreign key field",
862
- 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.",
863
- type: "string",
864
- "enum": [
865
- "uuid"
866
- ]
867
- },
868
- description: {
869
- 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.",
870
- type: "string"
871
- },
872
- relation: {
873
- title: "Prisma relation configuration defining the association details",
874
- 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.",
875
- type: "object",
876
- properties: {
877
- name: {
878
- title: "Name of the relation property in the Prisma model",
879
- description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"\n\n\n@pattern ^[a-zA-Z_][a-zA-Z0-9_]*$",
880
- type: "string"
881
- },
882
- targetModel: {
883
- title: "Name of the target model being referenced",
884
- description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
885
- type: "string"
886
- }
887
- },
888
- required: [
889
- "name",
890
- "targetModel"
891
- ]
892
- },
893
- unique: {
894
- title: "Whether this foreign key has a unique constraint",
895
- 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.",
896
- type: "boolean"
897
- },
898
- nullable: {
899
- title: "Whether this foreign key can be null (optional relationship)",
900
- description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
901
- type: "boolean"
902
- }
903
- },
904
- required: [
905
- "name",
906
- "type",
907
- "description",
908
- "relation",
909
- "unique",
910
- "nullable"
911
- ]
912
- }
835
+ unique: {
836
+ title: "Whether this foreign key has a unique constraint",
837
+ 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.",
838
+ type: "boolean"
913
839
  },
914
- plainFields: {
915
- title: "Array of regular data fields that don't reference other models",
916
- 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.",
917
- type: "array",
918
- items: {
919
- description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
920
- type: "object",
921
- properties: {
922
- name: {
923
- title: "Name of the field in the database table",
924
- description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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_]*$",
925
- type: "string"
926
- },
927
- type: {
928
- title: "Data type of the field for Prisma schema generation",
929
- 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
930
- type: "string",
931
- "enum": [
932
- "string",
933
- "boolean",
934
- "uuid",
935
- "uri",
936
- "int",
937
- "double",
938
- "datetime"
939
- ]
940
- },
941
- description: {
942
- title: "Description explaining the business purpose and usage of this field",
943
- 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
944
- type: "string"
945
- },
946
- nullable: {
947
- title: "Whether this field can contain null values",
948
- 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.",
949
- type: "boolean"
950
- }
951
- },
952
- required: [
953
- "name",
954
- "type",
955
- "description",
956
- "nullable"
957
- ]
958
- }
840
+ nullable: {
841
+ title: "Whether this foreign key can be null (optional relationship)",
842
+ 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.",
843
+ type: "boolean"
844
+ }
845
+ },
846
+ required: [
847
+ "name",
848
+ "type",
849
+ "description",
850
+ "relation",
851
+ "unique",
852
+ "nullable"
853
+ ]
854
+ }
855
+ },
856
+ plainFields: {
857
+ title: "Array of regular data fields that don't reference other models",
858
+ 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.",
859
+ type: "array",
860
+ items: {
861
+ description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
862
+ type: "object",
863
+ properties: {
864
+ name: {
865
+ title: "Name of the field in the database table",
866
+ description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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_]*$",
867
+ type: "string"
959
868
  },
960
- uniqueIndexes: {
961
- title: "Array of unique indexes for enforcing data integrity constraints",
962
- 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).",
963
- type: "array",
964
- items: {
965
- description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
966
- type: "object",
967
- properties: {
968
- fieldNames: {
969
- title: "Array of field names that together form the unique constraint",
970
- 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",
971
- type: "array",
972
- items: {
973
- type: "string"
974
- }
975
- },
976
- unique: {
977
- title: "Explicit marker indicating this is a unique index",
978
- 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\".",
979
- type: "boolean",
980
- "enum": [
981
- true
982
- ]
983
- }
984
- },
985
- required: [
986
- "fieldNames",
987
- "unique"
988
- ]
989
- }
869
+ type: {
870
+ title: "Data type of the field for Prisma schema generation",
871
+ 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
872
+ type: "string",
873
+ "enum": [
874
+ "string",
875
+ "boolean",
876
+ "uuid",
877
+ "uri",
878
+ "int",
879
+ "double",
880
+ "datetime"
881
+ ]
990
882
  },
991
- plainIndexes: {
992
- title: "Array of regular indexes for query performance optimization",
993
- 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.",
883
+ description: {
884
+ title: "Description explaining the business purpose and usage of this field",
885
+ 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
886
+ type: "string"
887
+ },
888
+ nullable: {
889
+ title: "Whether this field can contain null values",
890
+ 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.",
891
+ type: "boolean"
892
+ }
893
+ },
894
+ required: [
895
+ "name",
896
+ "type",
897
+ "description",
898
+ "nullable"
899
+ ]
900
+ }
901
+ },
902
+ uniqueIndexes: {
903
+ title: "Array of unique indexes for enforcing data integrity constraints",
904
+ 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).",
905
+ type: "array",
906
+ items: {
907
+ description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
908
+ type: "object",
909
+ properties: {
910
+ fieldNames: {
911
+ title: "Array of field names that together form the unique constraint",
912
+ 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",
994
913
  type: "array",
995
914
  items: {
996
- description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
997
- type: "object",
998
- properties: {
999
- fieldNames: {
1000
- title: "Array of field names to include in the performance index",
1001
- 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",
1002
- type: "array",
1003
- items: {
1004
- type: "string"
1005
- }
1006
- }
1007
- },
1008
- required: [
1009
- "fieldNames"
1010
- ]
915
+ type: "string"
1011
916
  }
1012
917
  },
1013
- ginIndexes: {
1014
- title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
1015
- 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.",
918
+ unique: {
919
+ title: "Explicit marker indicating this is a unique index",
920
+ 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\".",
921
+ type: "boolean",
922
+ "enum": [
923
+ true
924
+ ]
925
+ }
926
+ },
927
+ required: [
928
+ "fieldNames",
929
+ "unique"
930
+ ]
931
+ }
932
+ },
933
+ plainIndexes: {
934
+ title: "Array of regular indexes for query performance optimization",
935
+ 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.",
936
+ type: "array",
937
+ items: {
938
+ description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
939
+ type: "object",
940
+ properties: {
941
+ fieldNames: {
942
+ title: "Array of field names to include in the performance index",
943
+ 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",
1016
944
  type: "array",
1017
945
  items: {
1018
- description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
1019
- type: "object",
1020
- properties: {
1021
- fieldName: {
1022
- title: "Name of the text field to index for full-text search capabilities",
1023
- 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.",
1024
- type: "string"
1025
- }
1026
- },
1027
- required: [
1028
- "fieldName"
1029
- ]
946
+ type: "string"
1030
947
  }
1031
948
  }
1032
949
  },
1033
950
  required: [
1034
- "name",
1035
- "description",
1036
- "material",
1037
- "primaryField",
1038
- "foreignFields",
1039
- "plainFields",
1040
- "uniqueIndexes",
1041
- "plainIndexes",
1042
- "ginIndexes"
951
+ "fieldNames"
952
+ ]
953
+ }
954
+ },
955
+ ginIndexes: {
956
+ title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
957
+ 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.",
958
+ type: "array",
959
+ items: {
960
+ description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
961
+ type: "object",
962
+ properties: {
963
+ fieldName: {
964
+ title: "Name of the text field to index for full-text search capabilities",
965
+ 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.",
966
+ type: "string"
967
+ }
968
+ },
969
+ required: [
970
+ "fieldName"
1043
971
  ]
1044
972
  }
1045
973
  }
1046
974
  },
1047
975
  required: [
1048
- "filename",
1049
- "namespace",
1050
- "models"
976
+ "name",
977
+ "description",
978
+ "material",
979
+ "primaryField",
980
+ "foreignFields",
981
+ "plainFields",
982
+ "uniqueIndexes",
983
+ "plainIndexes",
984
+ "ginIndexes"
1051
985
  ]
1052
986
  }
1053
987
  }
1054
988
  },
1055
989
  required: [
1056
990
  "planning",
1057
- "files"
991
+ "models"
1058
992
  ],
1059
993
  additionalProperties: false,
1060
994
  $defs: {}
1061
995
  },
1062
- description: "Fixes validation errors in AutoBePrisma.IApplication structure while\npreserving ALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors - never remove business descriptions\n2. Apply minimal changes - preserve original design intent\n3. Return COMPLETE corrected structure - no data loss allowed\n4. Maintain referential integrity across all models\n\n## Preservation Requirements\n\n- Keep ALL model and field descriptions\n- Keep business logic and architectural patterns\n- Maintain relationship semantics and cardinality\n- Remove descriptions only when removing duplicate elements\n\n## Fix Strategy\n\n- Resolve structural validation errors without changing business intent\n- Remove duplicate fields/relations while preserving most appropriate ones\n- Fix invalid references and type mismatches\n- Ensure naming conventions and index rules compliance",
1063
- validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.filename && RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) && "string" === typeof input.namespace && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io3(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io9(elem))); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io4 = 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 && _io5(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io5 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel; const _io6 = 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 _io7 = 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 _io8 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io9 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
996
+ 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",
997
+ 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 && ("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-zA-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, {
1064
998
  path: _path + ".planning",
1065
999
  expected: "string",
1066
1000
  value: input.planning
1067
- }), (Array.isArray(input.files) || _report(_exceptionable, {
1068
- path: _path + ".files",
1069
- expected: "Array<AutoBePrisma.IFile>",
1070
- value: input.files
1071
- })) && input.files.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1072
- path: _path + ".files[" + _index10 + "]",
1073
- expected: "AutoBePrisma.IFile",
1074
- value: elem
1075
- })) && _vo1(elem, _path + ".files[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1076
- path: _path + ".files[" + _index10 + "]",
1077
- expected: "AutoBePrisma.IFile",
1078
- value: elem
1079
- })).every(flag => flag) || _report(_exceptionable, {
1080
- path: _path + ".files",
1081
- expected: "Array<AutoBePrisma.IFile>",
1082
- value: input.files
1083
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
1084
- path: _path + ".filename",
1085
- expected: "string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">",
1086
- value: input.filename
1087
- })) || _report(_exceptionable, {
1088
- path: _path + ".filename",
1089
- expected: "(string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">)",
1090
- value: input.filename
1091
- }), "string" === typeof input.namespace || _report(_exceptionable, {
1092
- path: _path + ".namespace",
1093
- expected: "string",
1094
- value: input.namespace
1095
1001
  }), (Array.isArray(input.models) || _report(_exceptionable, {
1096
1002
  path: _path + ".models",
1097
1003
  expected: "Array<AutoBePrisma.IModel>",
1098
1004
  value: input.models
1099
- })) && input.models.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1100
- path: _path + ".models[" + _index11 + "]",
1005
+ })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1006
+ path: _path + ".models[" + _index9 + "]",
1101
1007
  expected: "AutoBePrisma.IModel",
1102
1008
  value: elem
1103
- })) && _vo2(elem, _path + ".models[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1104
- path: _path + ".models[" + _index11 + "]",
1009
+ })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1010
+ path: _path + ".models[" + _index9 + "]",
1105
1011
  expected: "AutoBePrisma.IModel",
1106
1012
  value: elem
1107
1013
  })).every(flag => flag) || _report(_exceptionable, {
1108
1014
  path: _path + ".models",
1109
1015
  expected: "Array<AutoBePrisma.IModel>",
1110
1016
  value: input.models
1111
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1017
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1112
1018
  path: _path + ".name",
1113
1019
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1114
1020
  value: input.name
@@ -1128,7 +1034,7 @@ const collection = {
1128
1034
  path: _path + ".primaryField",
1129
1035
  expected: "AutoBePrisma.IPrimaryField",
1130
1036
  value: input.primaryField
1131
- })) && _vo3(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1037
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1132
1038
  path: _path + ".primaryField",
1133
1039
  expected: "AutoBePrisma.IPrimaryField",
1134
1040
  value: input.primaryField
@@ -1136,12 +1042,12 @@ const collection = {
1136
1042
  path: _path + ".foreignFields",
1137
1043
  expected: "Array<AutoBePrisma.IForeignField>",
1138
1044
  value: input.foreignFields
1139
- })) && input.foreignFields.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1140
- path: _path + ".foreignFields[" + _index12 + "]",
1045
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1046
+ path: _path + ".foreignFields[" + _index10 + "]",
1141
1047
  expected: "AutoBePrisma.IForeignField",
1142
1048
  value: elem
1143
- })) && _vo4(elem, _path + ".foreignFields[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1144
- path: _path + ".foreignFields[" + _index12 + "]",
1049
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1050
+ path: _path + ".foreignFields[" + _index10 + "]",
1145
1051
  expected: "AutoBePrisma.IForeignField",
1146
1052
  value: elem
1147
1053
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1152,12 +1058,12 @@ const collection = {
1152
1058
  path: _path + ".plainFields",
1153
1059
  expected: "Array<AutoBePrisma.IPlainField>",
1154
1060
  value: input.plainFields
1155
- })) && input.plainFields.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1156
- path: _path + ".plainFields[" + _index13 + "]",
1061
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1062
+ path: _path + ".plainFields[" + _index11 + "]",
1157
1063
  expected: "AutoBePrisma.IPlainField",
1158
1064
  value: elem
1159
- })) && _vo6(elem, _path + ".plainFields[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1160
- path: _path + ".plainFields[" + _index13 + "]",
1065
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1066
+ path: _path + ".plainFields[" + _index11 + "]",
1161
1067
  expected: "AutoBePrisma.IPlainField",
1162
1068
  value: elem
1163
1069
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1168,12 +1074,12 @@ const collection = {
1168
1074
  path: _path + ".uniqueIndexes",
1169
1075
  expected: "Array<AutoBePrisma.IUniqueIndex>",
1170
1076
  value: input.uniqueIndexes
1171
- })) && input.uniqueIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1172
- path: _path + ".uniqueIndexes[" + _index14 + "]",
1077
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1078
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1173
1079
  expected: "AutoBePrisma.IUniqueIndex",
1174
1080
  value: elem
1175
- })) && _vo7(elem, _path + ".uniqueIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1176
- path: _path + ".uniqueIndexes[" + _index14 + "]",
1081
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1082
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1177
1083
  expected: "AutoBePrisma.IUniqueIndex",
1178
1084
  value: elem
1179
1085
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1184,12 +1090,12 @@ const collection = {
1184
1090
  path: _path + ".plainIndexes",
1185
1091
  expected: "Array<AutoBePrisma.IPlainIndex>",
1186
1092
  value: input.plainIndexes
1187
- })) && input.plainIndexes.map((elem, _index15) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1188
- path: _path + ".plainIndexes[" + _index15 + "]",
1093
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1094
+ path: _path + ".plainIndexes[" + _index13 + "]",
1189
1095
  expected: "AutoBePrisma.IPlainIndex",
1190
1096
  value: elem
1191
- })) && _vo8(elem, _path + ".plainIndexes[" + _index15 + "]", true && _exceptionable) || _report(_exceptionable, {
1192
- path: _path + ".plainIndexes[" + _index15 + "]",
1097
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1098
+ path: _path + ".plainIndexes[" + _index13 + "]",
1193
1099
  expected: "AutoBePrisma.IPlainIndex",
1194
1100
  value: elem
1195
1101
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1200,19 +1106,19 @@ const collection = {
1200
1106
  path: _path + ".ginIndexes",
1201
1107
  expected: "Array<AutoBePrisma.IGinIndex>",
1202
1108
  value: input.ginIndexes
1203
- })) && input.ginIndexes.map((elem, _index16) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1204
- path: _path + ".ginIndexes[" + _index16 + "]",
1109
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1110
+ path: _path + ".ginIndexes[" + _index14 + "]",
1205
1111
  expected: "AutoBePrisma.IGinIndex",
1206
1112
  value: elem
1207
- })) && _vo9(elem, _path + ".ginIndexes[" + _index16 + "]", true && _exceptionable) || _report(_exceptionable, {
1208
- path: _path + ".ginIndexes[" + _index16 + "]",
1113
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1114
+ path: _path + ".ginIndexes[" + _index14 + "]",
1209
1115
  expected: "AutoBePrisma.IGinIndex",
1210
1116
  value: elem
1211
1117
  })).every(flag => flag) || _report(_exceptionable, {
1212
1118
  path: _path + ".ginIndexes",
1213
1119
  expected: "Array<AutoBePrisma.IGinIndex>",
1214
1120
  value: input.ginIndexes
1215
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1121
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1216
1122
  path: _path + ".name",
1217
1123
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1218
1124
  value: input.name
@@ -1228,7 +1134,7 @@ const collection = {
1228
1134
  path: _path + ".description",
1229
1135
  expected: "string",
1230
1136
  value: input.description
1231
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1137
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1232
1138
  path: _path + ".name",
1233
1139
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1234
1140
  value: input.name
@@ -1248,7 +1154,7 @@ const collection = {
1248
1154
  path: _path + ".relation",
1249
1155
  expected: "__type",
1250
1156
  value: input.relation
1251
- })) && _vo5(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1157
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1252
1158
  path: _path + ".relation",
1253
1159
  expected: "__type",
1254
1160
  value: input.relation
@@ -1260,7 +1166,7 @@ const collection = {
1260
1166
  path: _path + ".nullable",
1261
1167
  expected: "boolean",
1262
1168
  value: input.nullable
1263
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
1169
+ })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
1264
1170
  path: _path + ".name",
1265
1171
  expected: "string & Pattern<\"^[a-zA-Z_][a-zA-Z0-9_]*$\">",
1266
1172
  value: input.name
@@ -1272,7 +1178,7 @@ const collection = {
1272
1178
  path: _path + ".targetModel",
1273
1179
  expected: "string",
1274
1180
  value: input.targetModel
1275
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1181
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1276
1182
  path: _path + ".name",
1277
1183
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1278
1184
  value: input.name
@@ -1292,7 +1198,7 @@ const collection = {
1292
1198
  path: _path + ".nullable",
1293
1199
  expected: "boolean",
1294
1200
  value: input.nullable
1295
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1201
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1296
1202
  path: _path + ".fieldNames",
1297
1203
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1298
1204
  value: input.fieldNames
@@ -1304,8 +1210,8 @@ const collection = {
1304
1210
  path: _path + ".fieldNames",
1305
1211
  expected: "Array<> & UniqueItems<true>",
1306
1212
  value: input.fieldNames
1307
- })) && input.fieldNames.map((elem, _index17) => "string" === typeof elem || _report(_exceptionable, {
1308
- path: _path + ".fieldNames[" + _index17 + "]",
1213
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1214
+ path: _path + ".fieldNames[" + _index15 + "]",
1309
1215
  expected: "string",
1310
1216
  value: elem
1311
1217
  })).every(flag => flag)) || _report(_exceptionable, {
@@ -1316,7 +1222,7 @@ const collection = {
1316
1222
  path: _path + ".unique",
1317
1223
  expected: "true",
1318
1224
  value: input.unique
1319
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1225
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1320
1226
  path: _path + ".fieldNames",
1321
1227
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1322
1228
  value: input.fieldNames
@@ -1328,15 +1234,15 @@ const collection = {
1328
1234
  path: _path + ".fieldNames",
1329
1235
  expected: "Array<> & UniqueItems<true>",
1330
1236
  value: input.fieldNames
1331
- })) && input.fieldNames.map((elem, _index18) => "string" === typeof elem || _report(_exceptionable, {
1332
- path: _path + ".fieldNames[" + _index18 + "]",
1237
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1238
+ path: _path + ".fieldNames[" + _index16 + "]",
1333
1239
  expected: "string",
1334
1240
  value: elem
1335
1241
  })).every(flag => flag)) || _report(_exceptionable, {
1336
1242
  path: _path + ".fieldNames",
1337
1243
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1338
1244
  value: input.fieldNames
1339
- })].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1245
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1340
1246
  path: _path + ".fieldName",
1341
1247
  expected: "string",
1342
1248
  value: input.fieldName
@@ -1390,26 +1296,59 @@ const collection = {
1390
1296
  properties: {
1391
1297
  planning: {
1392
1298
  type: "string",
1393
- title: "Detailed execution plan for fixing AutoBePrisma validation errors",
1394
- description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints"
1299
+ 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, 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"
1395
1300
  },
1396
- files: {
1301
+ models: {
1397
1302
  type: "array",
1398
1303
  items: {
1399
1304
  type: "object",
1400
1305
  properties: {
1401
- filename: {
1306
+ name: {
1402
1307
  type: "string",
1403
- pattern: "^[a-zA-Z0-9._-]+\\.prisma$",
1404
- title: "Name of the schema file to be generated",
1405
- description: "Name of the schema file to be generated.\n\nShould follow the naming convention: \"schema-{number}-{domain}.prisma\"\nExamples: \"schema-02-systematic.prisma\", \"schema-03-actors.prisma\" The\nnumber indicates the dependency order for schema generation."
1308
+ pattern: "^[a-z][a-z0-9_]*$",
1309
+ title: "Name of the Prisma model (database table name)",
1310
+ description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\""
1406
1311
  },
1407
- namespace: {
1312
+ description: {
1408
1313
  type: "string",
1409
- title: "Business domain namespace that groups related models",
1410
- description: "Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as \"@\\namespace directive\".\nExamples from uploaded schemas: \"Systematic\", \"Actors\", \"Sales\", \"Carts\",\n\"Orders\", \"Coupons\", \"Coins\", \"Inquiries\", \"Favorites\", \"Articles\""
1314
+ 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 Example:\n \"Customer information, but not a person but a **connection** basis...\""
1411
1315
  },
1412
- models: {
1316
+ material: {
1317
+ type: "boolean",
1318
+ 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"
1319
+ },
1320
+ primaryField: {
1321
+ type: "object",
1322
+ properties: {
1323
+ name: {
1324
+ type: "string",
1325
+ pattern: "^[a-z][a-z0-9_]*$",
1326
+ title: "Name of the primary key field",
1327
+ description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table."
1328
+ },
1329
+ type: {
1330
+ type: "string",
1331
+ "enum": [
1332
+ "uuid"
1333
+ ],
1334
+ title: "Data type of the primary key field",
1335
+ 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."
1336
+ },
1337
+ description: {
1338
+ type: "string",
1339
+ title: "Description of the primary key field's purpose",
1340
+ 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."
1341
+ }
1342
+ },
1343
+ required: [
1344
+ "name",
1345
+ "type",
1346
+ "description"
1347
+ ],
1348
+ 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
1349
+ additionalProperties: false
1350
+ },
1351
+ foreignFields: {
1413
1352
  type: "array",
1414
1353
  items: {
1415
1354
  type: "object",
@@ -1417,333 +1356,243 @@ const collection = {
1417
1356
  name: {
1418
1357
  type: "string",
1419
1358
  pattern: "^[a-z][a-z0-9_]*$",
1420
- title: "Name of the Prisma model (database table name)",
1421
- description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\""
1359
+ title: "Name of the foreign key field",
1360
+ description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)"
1422
1361
  },
1423
- description: {
1362
+ type: {
1424
1363
  type: "string",
1425
- 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 Example:\n \"Customer information, but not a person but a **connection** basis...\""
1364
+ "enum": [
1365
+ "uuid"
1366
+ ],
1367
+ title: "Data type of the foreign key field",
1368
+ 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."
1426
1369
  },
1427
- material: {
1428
- type: "boolean",
1429
- 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"
1370
+ description: {
1371
+ type: "string",
1372
+ 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."
1430
1373
  },
1431
- primaryField: {
1374
+ relation: {
1432
1375
  type: "object",
1433
1376
  properties: {
1434
1377
  name: {
1435
1378
  type: "string",
1436
- pattern: "^[a-z][a-z0-9_]*$",
1437
- title: "Name of the primary key field",
1438
- description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table."
1379
+ pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
1380
+ title: "Name of the relation property in the Prisma model",
1381
+ description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\""
1439
1382
  },
1440
- type: {
1383
+ targetModel: {
1441
1384
  type: "string",
1442
- "enum": [
1443
- "uuid"
1444
- ],
1445
- title: "Data type of the primary key field",
1446
- 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."
1447
- },
1448
- description: {
1449
- type: "string",
1450
- title: "Description of the primary key field's purpose",
1451
- 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."
1385
+ title: "Name of the target model being referenced",
1386
+ description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\""
1452
1387
  }
1453
1388
  },
1454
1389
  required: [
1455
1390
  "name",
1456
- "type",
1457
- "description"
1391
+ "targetModel"
1458
1392
  ],
1459
- 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.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).",
1393
+ title: "Prisma relation configuration defining the association details",
1394
+ 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.",
1460
1395
  additionalProperties: false
1461
1396
  },
1462
- foreignFields: {
1463
- type: "array",
1464
- items: {
1465
- type: "object",
1466
- properties: {
1467
- name: {
1468
- type: "string",
1469
- pattern: "^[a-z][a-z0-9_]*$",
1470
- title: "Name of the foreign key field",
1471
- description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)"
1472
- },
1473
- type: {
1474
- type: "string",
1475
- "enum": [
1476
- "uuid"
1477
- ],
1478
- title: "Data type of the foreign key field",
1479
- 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."
1480
- },
1481
- description: {
1482
- type: "string",
1483
- 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."
1484
- },
1485
- relation: {
1486
- type: "object",
1487
- properties: {
1488
- name: {
1489
- type: "string",
1490
- pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
1491
- title: "Name of the relation property in the Prisma model",
1492
- description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\""
1493
- },
1494
- targetModel: {
1495
- type: "string",
1496
- title: "Name of the target model being referenced",
1497
- description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\""
1498
- }
1499
- },
1500
- required: [
1501
- "name",
1502
- "targetModel"
1503
- ],
1504
- title: "Prisma relation configuration defining the association details",
1505
- 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.",
1506
- additionalProperties: false
1507
- },
1508
- unique: {
1509
- type: "boolean",
1510
- title: "Whether this foreign key has a unique constraint",
1511
- 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."
1512
- },
1513
- nullable: {
1514
- type: "boolean",
1515
- title: "Whether this foreign key can be null (optional relationship)",
1516
- 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."
1517
- }
1518
- },
1519
- required: [
1520
- "name",
1521
- "type",
1522
- "description",
1523
- "relation",
1524
- "unique",
1525
- "nullable"
1526
- ],
1527
- description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
1528
- additionalProperties: false
1529
- },
1530
- title: "Array of foreign key fields that reference other models",
1531
- 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."
1397
+ unique: {
1398
+ type: "boolean",
1399
+ title: "Whether this foreign key has a unique constraint",
1400
+ 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."
1532
1401
  },
1533
- plainFields: {
1534
- type: "array",
1535
- items: {
1536
- type: "object",
1537
- properties: {
1538
- name: {
1539
- type: "string",
1540
- pattern: "^[a-z][a-z0-9_]*$",
1541
- title: "Name of the field in the database table",
1542
- description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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"
1543
- },
1544
- type: {
1545
- type: "string",
1546
- "enum": [
1547
- "string",
1548
- "boolean",
1549
- "uuid",
1550
- "uri",
1551
- "int",
1552
- "double",
1553
- "datetime"
1554
- ],
1555
- title: "Data type of the field for Prisma schema generation",
1556
- 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time"
1557
- },
1558
- description: {
1559
- type: "string",
1560
- title: "Description explaining the business purpose and usage of this field",
1561
- 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\""
1562
- },
1563
- nullable: {
1564
- type: "boolean",
1565
- title: "Whether this field can contain null values",
1566
- 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."
1567
- }
1568
- },
1569
- required: [
1570
- "name",
1571
- "type",
1572
- "description",
1573
- "nullable"
1574
- ],
1575
- description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
1576
- additionalProperties: false
1577
- },
1578
- title: "Array of regular data fields that don't reference other models",
1579
- 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."
1402
+ nullable: {
1403
+ type: "boolean",
1404
+ title: "Whether this foreign key can be null (optional relationship)",
1405
+ 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."
1406
+ }
1407
+ },
1408
+ required: [
1409
+ "name",
1410
+ "type",
1411
+ "description",
1412
+ "relation",
1413
+ "unique",
1414
+ "nullable"
1415
+ ],
1416
+ description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
1417
+ additionalProperties: false
1418
+ },
1419
+ title: "Array of foreign key fields that reference other models",
1420
+ 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."
1421
+ },
1422
+ plainFields: {
1423
+ type: "array",
1424
+ items: {
1425
+ type: "object",
1426
+ properties: {
1427
+ name: {
1428
+ type: "string",
1429
+ pattern: "^[a-z][a-z0-9_]*$",
1430
+ title: "Name of the field in the database table",
1431
+ description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\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"
1580
1432
  },
1581
- uniqueIndexes: {
1582
- type: "array",
1583
- items: {
1584
- type: "object",
1585
- properties: {
1586
- fieldNames: {
1587
- type: "array",
1588
- items: {
1589
- type: "string"
1590
- },
1591
- minItems: 1,
1592
- uniqueItems: true,
1593
- title: "Array of field names that together form the unique constraint",
1594
- 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\"]"
1595
- },
1596
- unique: {
1597
- type: "boolean",
1598
- "enum": [
1599
- true
1600
- ],
1601
- title: "Explicit marker indicating this is a unique index",
1602
- 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\"."
1603
- }
1604
- },
1605
- required: [
1606
- "fieldNames",
1607
- "unique"
1608
- ],
1609
- description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
1610
- additionalProperties: false
1611
- },
1612
- title: "Array of unique indexes for enforcing data integrity constraints",
1613
- 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)."
1433
+ type: {
1434
+ type: "string",
1435
+ "enum": [
1436
+ "string",
1437
+ "boolean",
1438
+ "uuid",
1439
+ "uri",
1440
+ "int",
1441
+ "double",
1442
+ "datetime"
1443
+ ],
1444
+ title: "Data type of the field for Prisma schema generation",
1445
+ 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- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time"
1614
1446
  },
1615
- plainIndexes: {
1447
+ description: {
1448
+ type: "string",
1449
+ title: "Description explaining the business purpose and usage of this field",
1450
+ 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 Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\""
1451
+ },
1452
+ nullable: {
1453
+ type: "boolean",
1454
+ title: "Whether this field can contain null values",
1455
+ 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."
1456
+ }
1457
+ },
1458
+ required: [
1459
+ "name",
1460
+ "type",
1461
+ "description",
1462
+ "nullable"
1463
+ ],
1464
+ description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
1465
+ additionalProperties: false
1466
+ },
1467
+ title: "Array of regular data fields that don't reference other models",
1468
+ 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."
1469
+ },
1470
+ uniqueIndexes: {
1471
+ type: "array",
1472
+ items: {
1473
+ type: "object",
1474
+ properties: {
1475
+ fieldNames: {
1616
1476
  type: "array",
1617
1477
  items: {
1618
- type: "object",
1619
- properties: {
1620
- fieldNames: {
1621
- type: "array",
1622
- items: {
1623
- type: "string"
1624
- },
1625
- minItems: 1,
1626
- uniqueItems: true,
1627
- title: "Array of field names to include in the performance index",
1628
- 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\"]"
1629
- }
1630
- },
1631
- required: [
1632
- "fieldNames"
1633
- ],
1634
- description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
1635
- additionalProperties: false
1478
+ type: "string"
1636
1479
  },
1637
- title: "Array of regular indexes for query performance optimization",
1638
- 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."
1480
+ minItems: 1,
1481
+ uniqueItems: true,
1482
+ title: "Array of field names that together form the unique constraint",
1483
+ 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\"]"
1639
1484
  },
1640
- ginIndexes: {
1485
+ unique: {
1486
+ type: "boolean",
1487
+ "enum": [
1488
+ true
1489
+ ],
1490
+ title: "Explicit marker indicating this is a unique index",
1491
+ 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\"."
1492
+ }
1493
+ },
1494
+ required: [
1495
+ "fieldNames",
1496
+ "unique"
1497
+ ],
1498
+ description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
1499
+ additionalProperties: false
1500
+ },
1501
+ title: "Array of unique indexes for enforcing data integrity constraints",
1502
+ 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)."
1503
+ },
1504
+ plainIndexes: {
1505
+ type: "array",
1506
+ items: {
1507
+ type: "object",
1508
+ properties: {
1509
+ fieldNames: {
1641
1510
  type: "array",
1642
1511
  items: {
1643
- type: "object",
1644
- properties: {
1645
- fieldName: {
1646
- type: "string",
1647
- title: "Name of the text field to index for full-text search capabilities",
1648
- 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."
1649
- }
1650
- },
1651
- required: [
1652
- "fieldName"
1653
- ],
1654
- description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
1655
- additionalProperties: false
1512
+ type: "string"
1656
1513
  },
1657
- title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
1658
- 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."
1514
+ minItems: 1,
1515
+ uniqueItems: true,
1516
+ title: "Array of field names to include in the performance index",
1517
+ 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\"]"
1659
1518
  }
1660
1519
  },
1661
1520
  required: [
1662
- "name",
1663
- "description",
1664
- "material",
1665
- "primaryField",
1666
- "foreignFields",
1667
- "plainFields",
1668
- "uniqueIndexes",
1669
- "plainIndexes",
1670
- "ginIndexes"
1521
+ "fieldNames"
1671
1522
  ],
1672
- description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
1523
+ description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
1673
1524
  additionalProperties: false
1674
1525
  },
1675
- title: "Array of Prisma models (database tables) within this domain",
1676
- description: "Array of Prisma models (database tables) within this domain.\n\nEach model represents a business entity or concept within the namespace.\nModels can reference each other through foreign key relationships."
1526
+ title: "Array of regular indexes for query performance optimization",
1527
+ 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."
1528
+ },
1529
+ ginIndexes: {
1530
+ type: "array",
1531
+ items: {
1532
+ type: "object",
1533
+ properties: {
1534
+ fieldName: {
1535
+ type: "string",
1536
+ title: "Name of the text field to index for full-text search capabilities",
1537
+ 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."
1538
+ }
1539
+ },
1540
+ required: [
1541
+ "fieldName"
1542
+ ],
1543
+ description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
1544
+ additionalProperties: false
1545
+ },
1546
+ title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
1547
+ 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."
1677
1548
  }
1678
1549
  },
1679
1550
  required: [
1680
- "filename",
1681
- "namespace",
1682
- "models"
1551
+ "name",
1552
+ "description",
1553
+ "material",
1554
+ "primaryField",
1555
+ "foreignFields",
1556
+ "plainFields",
1557
+ "uniqueIndexes",
1558
+ "plainIndexes",
1559
+ "ginIndexes"
1683
1560
  ],
1684
- description: "Description of the current {@link AutoBePrisma.IFile} type:\n\n> Interface representing a single Prisma schema file within the application.\n> \n> Each file focuses on a specific business domain and contains related\n> models. File organization follows domain-driven design principles as seen\n> in the uploaded schemas.",
1561
+ description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based 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_)",
1685
1562
  additionalProperties: false
1686
1563
  },
1687
- description: "Original AutoBePrisma.IApplication structure that contains validation\nerrors and needs correction.\n\n\uD83D\uDCE5 Input Structure:\n\n- Complete IApplication with files array containing validation errors\n- Each file contains models with potential structural issues\n- Errors may include duplications, invalid references, or constraint\n violations\n\n\uD83D\uDD0D Expected Validation Issues:\n\n- Duplicate model names across files\n- Duplicate field/relation names within models\n- Invalid foreign key references to non-existent models\n- Single foreign key fields in index arrays\n- Non-plural model names or invalid naming conventions\n\n\uD83D\uDCDD Application Content Analysis:\n\n- All models with their complete field definitions\n- All relationships with targetModel and targetfield configurations\n- All indexes (unique, plain, GIN) with field references\n- All business descriptions and requirement mappings\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Processing Notes:\n\n- Structure may contain validation errors that prevent code generation\n- Some models might reference non-existent targets\n- Field names might violate naming conventions\n- Index configurations might include forbidden single foreign keys\n- Business logic and descriptions must be preserved during fixes"
1564
+ 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"
1688
1565
  }
1689
1566
  },
1690
1567
  required: [
1691
1568
  "planning",
1692
- "files"
1569
+ "models"
1693
1570
  ],
1694
1571
  description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
1695
1572
  additionalProperties: false
1696
1573
  },
1697
- description: "Fixes validation errors in AutoBePrisma.IApplication structure while\npreserving ALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors - never remove business descriptions\n2. Apply minimal changes - preserve original design intent\n3. Return COMPLETE corrected structure - no data loss allowed\n4. Maintain referential integrity across all models\n\n## Preservation Requirements\n\n- Keep ALL model and field descriptions\n- Keep business logic and architectural patterns\n- Maintain relationship semantics and cardinality\n- Remove descriptions only when removing duplicate elements\n\n## Fix Strategy\n\n- Resolve structural validation errors without changing business intent\n- Remove duplicate fields/relations while preserving most appropriate ones\n- Fix invalid references and type mismatches\n- Ensure naming conventions and index rules compliance",
1698
- validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.filename && RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) && "string" === typeof input.namespace && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io3(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && (Array.isArray(input.plainFields) && input.plainFields.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every(elem => "object" === typeof elem && null !== elem && _io8(elem))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every(elem => "object" === typeof elem && null !== elem && _io9(elem))); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; const _io4 = 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 && _io5(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable; const _io5 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel; const _io6 = 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 _io7 = 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 _io8 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io9 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
1574
+ 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",
1575
+ 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 && ("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-zA-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, {
1699
1576
  path: _path + ".planning",
1700
1577
  expected: "string",
1701
1578
  value: input.planning
1702
- }), (Array.isArray(input.files) || _report(_exceptionable, {
1703
- path: _path + ".files",
1704
- expected: "Array<AutoBePrisma.IFile>",
1705
- value: input.files
1706
- })) && input.files.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1707
- path: _path + ".files[" + _index10 + "]",
1708
- expected: "AutoBePrisma.IFile",
1709
- value: elem
1710
- })) && _vo1(elem, _path + ".files[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1711
- path: _path + ".files[" + _index10 + "]",
1712
- expected: "AutoBePrisma.IFile",
1713
- value: elem
1714
- })).every(flag => flag) || _report(_exceptionable, {
1715
- path: _path + ".files",
1716
- expected: "Array<AutoBePrisma.IFile>",
1717
- value: input.files
1718
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
1719
- path: _path + ".filename",
1720
- expected: "string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">",
1721
- value: input.filename
1722
- })) || _report(_exceptionable, {
1723
- path: _path + ".filename",
1724
- expected: "(string & Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">)",
1725
- value: input.filename
1726
- }), "string" === typeof input.namespace || _report(_exceptionable, {
1727
- path: _path + ".namespace",
1728
- expected: "string",
1729
- value: input.namespace
1730
1579
  }), (Array.isArray(input.models) || _report(_exceptionable, {
1731
1580
  path: _path + ".models",
1732
1581
  expected: "Array<AutoBePrisma.IModel>",
1733
1582
  value: input.models
1734
- })) && input.models.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1735
- path: _path + ".models[" + _index11 + "]",
1583
+ })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1584
+ path: _path + ".models[" + _index9 + "]",
1736
1585
  expected: "AutoBePrisma.IModel",
1737
1586
  value: elem
1738
- })) && _vo2(elem, _path + ".models[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1739
- path: _path + ".models[" + _index11 + "]",
1587
+ })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1588
+ path: _path + ".models[" + _index9 + "]",
1740
1589
  expected: "AutoBePrisma.IModel",
1741
1590
  value: elem
1742
1591
  })).every(flag => flag) || _report(_exceptionable, {
1743
1592
  path: _path + ".models",
1744
1593
  expected: "Array<AutoBePrisma.IModel>",
1745
1594
  value: input.models
1746
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1595
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1747
1596
  path: _path + ".name",
1748
1597
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1749
1598
  value: input.name
@@ -1763,7 +1612,7 @@ const collection = {
1763
1612
  path: _path + ".primaryField",
1764
1613
  expected: "AutoBePrisma.IPrimaryField",
1765
1614
  value: input.primaryField
1766
- })) && _vo3(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1615
+ })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1767
1616
  path: _path + ".primaryField",
1768
1617
  expected: "AutoBePrisma.IPrimaryField",
1769
1618
  value: input.primaryField
@@ -1771,12 +1620,12 @@ const collection = {
1771
1620
  path: _path + ".foreignFields",
1772
1621
  expected: "Array<AutoBePrisma.IForeignField>",
1773
1622
  value: input.foreignFields
1774
- })) && input.foreignFields.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1775
- path: _path + ".foreignFields[" + _index12 + "]",
1623
+ })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1624
+ path: _path + ".foreignFields[" + _index10 + "]",
1776
1625
  expected: "AutoBePrisma.IForeignField",
1777
1626
  value: elem
1778
- })) && _vo4(elem, _path + ".foreignFields[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1779
- path: _path + ".foreignFields[" + _index12 + "]",
1627
+ })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1628
+ path: _path + ".foreignFields[" + _index10 + "]",
1780
1629
  expected: "AutoBePrisma.IForeignField",
1781
1630
  value: elem
1782
1631
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1787,12 +1636,12 @@ const collection = {
1787
1636
  path: _path + ".plainFields",
1788
1637
  expected: "Array<AutoBePrisma.IPlainField>",
1789
1638
  value: input.plainFields
1790
- })) && input.plainFields.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1791
- path: _path + ".plainFields[" + _index13 + "]",
1639
+ })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1640
+ path: _path + ".plainFields[" + _index11 + "]",
1792
1641
  expected: "AutoBePrisma.IPlainField",
1793
1642
  value: elem
1794
- })) && _vo6(elem, _path + ".plainFields[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1795
- path: _path + ".plainFields[" + _index13 + "]",
1643
+ })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1644
+ path: _path + ".plainFields[" + _index11 + "]",
1796
1645
  expected: "AutoBePrisma.IPlainField",
1797
1646
  value: elem
1798
1647
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1803,12 +1652,12 @@ const collection = {
1803
1652
  path: _path + ".uniqueIndexes",
1804
1653
  expected: "Array<AutoBePrisma.IUniqueIndex>",
1805
1654
  value: input.uniqueIndexes
1806
- })) && input.uniqueIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1807
- path: _path + ".uniqueIndexes[" + _index14 + "]",
1655
+ })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1656
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1808
1657
  expected: "AutoBePrisma.IUniqueIndex",
1809
1658
  value: elem
1810
- })) && _vo7(elem, _path + ".uniqueIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1811
- path: _path + ".uniqueIndexes[" + _index14 + "]",
1659
+ })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1660
+ path: _path + ".uniqueIndexes[" + _index12 + "]",
1812
1661
  expected: "AutoBePrisma.IUniqueIndex",
1813
1662
  value: elem
1814
1663
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1819,12 +1668,12 @@ const collection = {
1819
1668
  path: _path + ".plainIndexes",
1820
1669
  expected: "Array<AutoBePrisma.IPlainIndex>",
1821
1670
  value: input.plainIndexes
1822
- })) && input.plainIndexes.map((elem, _index15) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1823
- path: _path + ".plainIndexes[" + _index15 + "]",
1671
+ })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1672
+ path: _path + ".plainIndexes[" + _index13 + "]",
1824
1673
  expected: "AutoBePrisma.IPlainIndex",
1825
1674
  value: elem
1826
- })) && _vo8(elem, _path + ".plainIndexes[" + _index15 + "]", true && _exceptionable) || _report(_exceptionable, {
1827
- path: _path + ".plainIndexes[" + _index15 + "]",
1675
+ })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1676
+ path: _path + ".plainIndexes[" + _index13 + "]",
1828
1677
  expected: "AutoBePrisma.IPlainIndex",
1829
1678
  value: elem
1830
1679
  })).every(flag => flag) || _report(_exceptionable, {
@@ -1835,19 +1684,19 @@ const collection = {
1835
1684
  path: _path + ".ginIndexes",
1836
1685
  expected: "Array<AutoBePrisma.IGinIndex>",
1837
1686
  value: input.ginIndexes
1838
- })) && input.ginIndexes.map((elem, _index16) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1839
- path: _path + ".ginIndexes[" + _index16 + "]",
1687
+ })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1688
+ path: _path + ".ginIndexes[" + _index14 + "]",
1840
1689
  expected: "AutoBePrisma.IGinIndex",
1841
1690
  value: elem
1842
- })) && _vo9(elem, _path + ".ginIndexes[" + _index16 + "]", true && _exceptionable) || _report(_exceptionable, {
1843
- path: _path + ".ginIndexes[" + _index16 + "]",
1691
+ })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1692
+ path: _path + ".ginIndexes[" + _index14 + "]",
1844
1693
  expected: "AutoBePrisma.IGinIndex",
1845
1694
  value: elem
1846
1695
  })).every(flag => flag) || _report(_exceptionable, {
1847
1696
  path: _path + ".ginIndexes",
1848
1697
  expected: "Array<AutoBePrisma.IGinIndex>",
1849
1698
  value: input.ginIndexes
1850
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1699
+ })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1851
1700
  path: _path + ".name",
1852
1701
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1853
1702
  value: input.name
@@ -1863,7 +1712,7 @@ const collection = {
1863
1712
  path: _path + ".description",
1864
1713
  expected: "string",
1865
1714
  value: input.description
1866
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1715
+ })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1867
1716
  path: _path + ".name",
1868
1717
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1869
1718
  value: input.name
@@ -1883,7 +1732,7 @@ const collection = {
1883
1732
  path: _path + ".relation",
1884
1733
  expected: "__type",
1885
1734
  value: input.relation
1886
- })) && _vo5(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1735
+ })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1887
1736
  path: _path + ".relation",
1888
1737
  expected: "__type",
1889
1738
  value: input.relation
@@ -1895,7 +1744,7 @@ const collection = {
1895
1744
  path: _path + ".nullable",
1896
1745
  expected: "boolean",
1897
1746
  value: input.nullable
1898
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
1747
+ })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
1899
1748
  path: _path + ".name",
1900
1749
  expected: "string & Pattern<\"^[a-zA-Z_][a-zA-Z0-9_]*$\">",
1901
1750
  value: input.name
@@ -1907,7 +1756,7 @@ const collection = {
1907
1756
  path: _path + ".targetModel",
1908
1757
  expected: "string",
1909
1758
  value: input.targetModel
1910
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1759
+ })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1911
1760
  path: _path + ".name",
1912
1761
  expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
1913
1762
  value: input.name
@@ -1927,7 +1776,7 @@ const collection = {
1927
1776
  path: _path + ".nullable",
1928
1777
  expected: "boolean",
1929
1778
  value: input.nullable
1930
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1779
+ })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1931
1780
  path: _path + ".fieldNames",
1932
1781
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1933
1782
  value: input.fieldNames
@@ -1939,8 +1788,8 @@ const collection = {
1939
1788
  path: _path + ".fieldNames",
1940
1789
  expected: "Array<> & UniqueItems<true>",
1941
1790
  value: input.fieldNames
1942
- })) && input.fieldNames.map((elem, _index17) => "string" === typeof elem || _report(_exceptionable, {
1943
- path: _path + ".fieldNames[" + _index17 + "]",
1791
+ })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1792
+ path: _path + ".fieldNames[" + _index15 + "]",
1944
1793
  expected: "string",
1945
1794
  value: elem
1946
1795
  })).every(flag => flag)) || _report(_exceptionable, {
@@ -1951,7 +1800,7 @@ const collection = {
1951
1800
  path: _path + ".unique",
1952
1801
  expected: "true",
1953
1802
  value: input.unique
1954
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1803
+ })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1955
1804
  path: _path + ".fieldNames",
1956
1805
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1957
1806
  value: input.fieldNames
@@ -1963,15 +1812,15 @@ const collection = {
1963
1812
  path: _path + ".fieldNames",
1964
1813
  expected: "Array<> & UniqueItems<true>",
1965
1814
  value: input.fieldNames
1966
- })) && input.fieldNames.map((elem, _index18) => "string" === typeof elem || _report(_exceptionable, {
1967
- path: _path + ".fieldNames[" + _index18 + "]",
1815
+ })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1816
+ path: _path + ".fieldNames[" + _index16 + "]",
1968
1817
  expected: "string",
1969
1818
  value: elem
1970
1819
  })).every(flag => flag)) || _report(_exceptionable, {
1971
1820
  path: _path + ".fieldNames",
1972
1821
  expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1973
1822
  value: input.fieldNames
1974
- })].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1823
+ })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1975
1824
  path: _path + ".fieldName",
1976
1825
  expected: "string",
1977
1826
  value: input.fieldName