packages/v2/core/src/commands/ARCHITECTURE.md
Declaration: If the folder I belong to changes, please update me, especially core domain concepts. Add examples or example file paths for abstract concepts when needed.
zod.safeParse and Result-only error flow.ICommandBus.application/services/** and reused there
(example: services/RecordCreationService.ts used by both CreateRecordHandler and
SubmitRecordHandler).ARCHITECTURE.md - Role: folder architecture note; Purpose: describe command layer scope.CommandHandler.ts - Role: handler interface + registry; Purpose: let the command bus resolve handlers.CreateTableCommand.ts - Role: command DTO + schema; Purpose: validate inputs and build TableBuilder inputs.CreateTableHandler.ts - Role: command handler; Purpose: build aggregate and persist/publish.CreateTablesCommand.ts - Role: command DTO + schema; Purpose: validate batch table inputs.CreateTablesHandler.ts - Role: command handler; Purpose: create multiple tables in one unit of work.CreateFieldCommand.ts - Role: command DTO + schema; Purpose: validate inputs for adding a field.CreateFieldHandler.ts - Role: command handler; Purpose: update table meta/schema and publish events.CreateRecordCommand.ts - Role: command DTO + schema; Purpose: validate inputs for creating a record.CreateRecordHandler.ts - Role: command handler; Purpose: create record, persist, publish.CreateRecordsCommand.ts - Role: command DTO + schema; Purpose: validate inputs for batch record creation.CreateRecordsHandler.ts - Role: command handler; Purpose: create records, persist, publish.CreateRecordsStreamCommand.ts - Role: command DTO + schema; Purpose: validate streaming record inputs.CreateRecordsStreamHandler.ts - Role: command handler; Purpose: stream-create records, persist, publish.DeleteFieldCommand.ts - Role: command DTO + schema; Purpose: validate inputs for deleting a field.DeleteFieldHandler.ts - Role: command handler; Purpose: remove field metadata/schema and publish events.FieldValidation.ts - Role: helper; Purpose: decide notNull/unique support by field type.DeleteTableCommand.ts - Role: command DTO + schema; Purpose: validate inputs for deletion.DeleteTableHandler.ts - Role: command handler; Purpose: delete table state/schema and publish events.ImportCsvCommand.ts - Role: command DTO + schema; Purpose: validate CSV import inputs.ImportCsvHandler.ts - Role: command handler; Purpose: import CSV and create records.ImportDotTeaStructureCommand.ts - Role: command DTO + schema; Purpose: validate dottea structure imports.ImportDotTeaStructureHandler.ts - Role: command handler; Purpose: import dottea structure tables.RenameTableCommand.ts - Role: command DTO + schema; Purpose: validate inputs for renaming.RenameTableHandler.ts - Role: command handler; Purpose: persist table rename and publish events.TableFieldSpecs.ts - Role: parsing helpers; Purpose: shared field input schema + spec builders.UpdateRecordCommand.ts - Role: command DTO + schema; Purpose: validate inputs for updating a record.UpdateRecordHandler.ts - Role: command handler; Purpose: update record, persist, publish.packages/v2/test-node/src/commands/CreateTableHandler.spec.ts - Command flow and port usage.