Skip to content

fix: omit server-generated fields from nested CustomerSchema in CreateSalesOrderInput#32

Merged
AJITHMELVIN merged 3 commits into
commerce-operations-foundation:developfrom
VirtoCommerce:fix/customer-schema-input
Jun 4, 2026
Merged

fix: omit server-generated fields from nested CustomerSchema in CreateSalesOrderInput#32
AJITHMELVIN merged 3 commits into
commerce-operations-foundation:developfrom
VirtoCommerce:fix/customer-schema-input

Conversation

@basilkot

@basilkot basilkot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • CreateSalesOrderInputSchema omits immutable fields (id, createdAt, updatedAt, tenantId) from the top-level OrderSchema, but the nested CustomerSchema still inherited them as required from ObjectProps
  • This caused AJV validation to reject create-sales-order requests where customer was provided without createdAt/updatedAt/tenantId — fields that are server-generated and should never come from the client
  • Override the customer field to use CustomerSchema.omit({ createdAt, updatedAt, tenantId }), keeping id for customer identification

Test plan

  • Server typecheck passes (tsc --noEmit)
  • All 162 server unit tests pass
  • Verify create-sales-order accepts customer: { id: "..." } without createdAt/updatedAt/tenantId

🤖 Generated with Claude Code

…eSalesOrderInput

CreateSalesOrderInputSchema omitted immutable fields (id, createdAt, updatedAt,
tenantId) from the top-level OrderSchema, but the nested CustomerSchema still
inherited them as required from ObjectProps. This caused AJV validation to reject
create-sales-order requests where customer was provided without createdAt,
updatedAt, or tenantId — fields that are server-generated and should never come
from the client.

Override the customer field to use CustomerSchema.omit({ createdAt, updatedAt,
tenantId }), keeping id for customer identification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timdauer timdauer self-requested a review March 16, 2026 14:01
@OlegoO

OlegoO commented Apr 28, 2026

Copy link
Copy Markdown

@timdauer Any updates on when you are planning to release it?
Now we are using own fork.

@AJITHMELVIN AJITHMELVIN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed on the grooming call, good to merge.

@AJITHMELVIN AJITHMELVIN merged commit 02e193a into commerce-operations-foundation:develop Jun 4, 2026
5 checks passed
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.

4 participants