Skip to content

feat(types): add Zod runtime validation schemas for core resource DTOs - #173

Merged
Cjay-Cyber-2 merged 2 commits into
ASTROIDX556:mainfrom
entitydev30:feat/zod-schemas-146
Sep 1, 2026
Merged

feat(types): add Zod runtime validation schemas for core resource DTOs#173
Cjay-Cyber-2 merged 2 commits into
ASTROIDX556:mainfrom
entitydev30:feat/zod-schemas-146

Conversation

@entitydev30

Copy link
Copy Markdown
Contributor

Implements issue #146: Zod validation schemas for core domain models and DTOs in @astroid/types, enabling robust runtime validation at SDK boundaries.

Changes:

  • Added Zod as a dependency to @astroid/types
  • Created packages/types/src/schemas.ts with:
    • Enum schemas for all platform enumerations (AgentRole, WalletType, PolicyType, TransactionStatus, etc.)
    • Entity schemas for core domain models (Agent, Wallet, Policy, Budget, Transaction, Proposal, Approval, Notification, etc.)
    • DTO input schemas for create/update operations
    • Generic validate() and validateOrThrow() helpers
    • Convenience validators: validateAgent, validateWallet, validatePolicy, validateBudget, validateTransaction, and DTO input validators
  • Exported all schemas and helpers from @astroid/types entry point
  • Added 39 comprehensive tests covering:
    • Valid payload acceptance for all entity schemas
    • Invalid payload rejection with descriptive error messages
    • Missing required field detection
    • Invalid enum value detection
    • DTO input schema validation
    • Validation helper functions (validate, validateOrThrow, convenience)
    • Type compatibility verification with TypeScript interfaces

🤖 Generated with Codebuff

Summary

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs

Related issue

Closes #146

Checklist

  • npm run build passes
  • npm run typecheck passes
  • npm run lint passes
  • No secrets in tracked files

Implements issue ASTROIDX556#146: Zod validation schemas for core domain models
and DTOs in @astroid/types, enabling robust runtime validation at SDK
boundaries.

Changes:

- Added Zod as a dependency to @astroid/types
- Created packages/types/src/schemas.ts with:
  - Enum schemas for all platform enumerations (AgentRole, WalletType,
    PolicyType, TransactionStatus, etc.)
  - Entity schemas for core domain models (Agent, Wallet, Policy,
    Budget, Transaction, Proposal, Approval, Notification, etc.)
  - DTO input schemas for create/update operations
  - Generic validate() and validateOrThrow() helpers
  - Convenience validators: validateAgent, validateWallet,
    validatePolicy, validateBudget, validateTransaction, and DTO input
    validators
- Exported all schemas and helpers from @astroid/types entry point
- Added 39 comprehensive tests covering:
  - Valid payload acceptance for all entity schemas
  - Invalid payload rejection with descriptive error messages
  - Missing required field detection
  - Invalid enum value detection
  - DTO input schema validation
  - Validation helper functions (validate, validateOrThrow, convenience)
  - Type compatibility verification with TypeScript interfaces

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@entitydev30 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #146.
Verdict: clean

Successfully added Zod runtime validation schemas, helper functions, exports, and tests for core resource DTOs in @astroid/types.

Reviewed commit: 7efdd6d96b629d199d307d3f6c9a65b9ddbc2ae7.
CI and merge eligibility are checked separately.

@Cjay-Cyber-2
Cjay-Cyber-2 merged commit c8360ec into ASTROIDX556:main Sep 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Zod runtime validation schemas for core resource DTOs in @astroid/types

2 participants