Skip to content

Commit 8244be6

Browse files
wagnertclaude
andcommitted
docs(SOSO-246): update DI integration docs for v2.0.0 field types
Updated all SOSO-246 documentation to reflect SOSO-247 v2.0.0 changes: **Schema Examples Updated:** - Replaced generic types (string, number) with AppSheet field types (Text, Name, Email, Price, etc.) - Changed 'enum' property to 'allowedValues' - Added 'required' flags to all field definitions - Updated to full FieldDefinition object format **Files Updated:** - EXAMPLES.md: Updated test schema with v2.0.0 format - TESTING.md: Updated integration test schema - INTEGRATION_CONCEPT.md: * Added v2.0.0 compatibility note * Added new section 3.8 on Validators (NO DI required) * Clarified that validators use static methods - README.md: Added v2.0.0 update notice **Key Changes:** - All schema examples now use AppSheet field types - Validators documented as stateless (no DI needed) - DI integration remains fully compatible with v2.0.0 - No breaking changes to DI architecture Related: SOSO-247, v2.0.0 breaking changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 09c300e commit 8244be6

File tree

4 files changed

+74
-18
lines changed

4 files changed

+74
-18
lines changed

docs/SOSO-246/EXAMPLES.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ main();
169169
import 'reflect-metadata';
170170
import { setupTestContainer, SchemaConfig } from '@techdivision/appsheet';
171171

172-
// Test schema
172+
// Test schema (v2.0.0 format with AppSheet field types)
173173
const testSchema: SchemaConfig = {
174174
connections: {
175175
main: {
@@ -180,20 +180,24 @@ const testSchema: SchemaConfig = {
180180
tableName: 'users',
181181
keyField: 'id',
182182
fields: {
183-
id: 'string',
184-
name: 'string',
185-
email: 'string',
186-
role: { type: 'string', enum: ['admin', 'user'] }
183+
id: { type: 'Text', required: true },
184+
name: { type: 'Name', required: true },
185+
email: { type: 'Email', required: true },
186+
role: {
187+
type: 'Enum',
188+
required: true,
189+
allowedValues: ['admin', 'user']
190+
}
187191
}
188192
},
189193
orders: {
190194
tableName: 'orders',
191195
keyField: 'id',
192196
fields: {
193-
id: 'string',
194-
user_id: 'string',
195-
total: 'number',
196-
status: 'string'
197+
id: { type: 'Text', required: true },
198+
user_id: { type: 'Text', required: true },
199+
total: { type: 'Price', required: true },
200+
status: { type: 'Text', required: false }
197201
}
198202
}
199203
}

docs/SOSO-246/INTEGRATION_CONCEPT.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
**Projekt:** @techdivision/appsheet
55
**Status:** Konzeptphase
66
**Datum:** 2025-01-20
7+
**Aktualisiert:** 2025-11-21 (Post-SOSO-247 v2.0.0)
8+
9+
> **⚠️ Wichtig:** Dieses Dokument berücksichtigt die Änderungen aus SOSO-247 (v2.0.0):
10+
> - Alle Schema-Beispiele verwenden AppSheet field types (Text, Email, Enum, etc.)
11+
> - Validators (AppSheetTypeValidator, FormatValidator) sind stateless und benötigen keine DI
12+
> - FieldDefinition verwendet `allowedValues` statt `enum`
713
814
---
915

@@ -312,9 +318,48 @@ export class DynamicTable<T = Record<string, any>> {
312318

313319
---
314320

321+
#### 3.8 Validation Layer - NO DI Required
322+
323+
**Validators aus SOSO-247 (v2.0.0):**
324+
325+
Die neuen Validator-Klassen sind **stateless** und verwenden **statische Methoden**. Sie benötigen **KEINE Dependency Injection**:
326+
327+
```typescript
328+
// src/utils/validators/AppSheetTypeValidator.ts
329+
export class AppSheetTypeValidator {
330+
// Statische Methoden - keine DI nötig
331+
static validate(fieldName: string, fieldType: AppSheetFieldType, value: any, rowIndex: number): void
332+
static validateEnum(...): void
333+
static validateRequired(...): void
334+
}
335+
336+
// src/utils/validators/FormatValidator.ts
337+
export class FormatValidator {
338+
// Statische Methoden - keine DI nötig
339+
static validateEmail(fieldName: string, value: string, rowIndex: number): void
340+
static validateURL(...): void
341+
static validatePhone(...): void
342+
}
343+
344+
// src/utils/validators/BaseTypeValidator.ts
345+
export class BaseTypeValidator {
346+
// Statische Methoden - keine DI nötig
347+
static validateString(...): void
348+
static validateNumber(...): void
349+
}
350+
```
351+
352+
**Begründung:**
353+
- Validators sind **pure functions** ohne State
354+
- Keine Dependencies auf externe Services
355+
- Performance-optimal durch statische Methoden
356+
- Einfach testbar ohne DI-Setup
357+
358+
---
359+
315360
### Phase 4: DI Helper & Utilities (Tag 3)
316361

317-
#### 3.8 DI Helper Module
362+
#### 3.9 DI Helper Module
318363

319364
**Neues Modul: src/di/index.ts**
320365

docs/SOSO-246/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
**JIRA:** https://techdivision.atlassian.net/browse/SOSO-246
55
**Repository:** https://github.com/techdivision/appsheet-mcp-server
66
**Branch:** staging
7+
**Aktualisiert:** 2025-11-21 (Post-SOSO-247 v2.0.0)
8+
9+
> **⚠️ Hinweis:** Alle Beispiele in dieser Dokumentation wurden auf die v2.0.0 AppSheet field types aktualisiert (SOSO-247).
710
811
---
912

docs/SOSO-246/TESTING.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,24 @@ describe('Schema Integration Tests', () => {
261261
tableName: 'users',
262262
keyField: 'id',
263263
fields: {
264-
id: 'string',
265-
name: 'string',
266-
email: 'string',
267-
role: { type: 'string', enum: ['admin', 'user'] }
264+
id: { type: 'Text', required: true },
265+
name: { type: 'Name', required: true },
266+
email: { type: 'Email', required: true },
267+
role: {
268+
type: 'Enum',
269+
required: true,
270+
allowedValues: ['admin', 'user']
271+
}
268272
}
269273
},
270274
orders: {
271275
tableName: 'orders',
272276
keyField: 'id',
273277
fields: {
274-
id: 'string',
275-
user_id: 'string',
276-
total: 'number',
277-
status: 'string'
278+
id: { type: 'Text', required: true },
279+
user_id: { type: 'Text', required: true },
280+
total: { type: 'Price', required: true },
281+
status: { type: 'Text', required: false }
278282
}
279283
}
280284
}

0 commit comments

Comments
 (0)