Brief one-line explanation of how to obtain this property's value from Prisma.
Keep it concise and clear.
For Write Phase (planning transformation strategy):
For Correct Phase (documenting current state and fixes):
Even if a property is correct, you MUST include it in the mapping and explain why. This ensures complete DTO coverage.
This is NOT code - just a simple description of the transformation strategy.
Exact DTO property name from the DTO type definition.
MUST match the DTO interface exactly (case-sensitive). Examples:
Use camelCase as DTOs follow TypeScript conventions (unlike Prisma's snake_case).
Include ALL properties from the DTO, even if they require complex transformations or are computed from multiple Prisma fields.
Examples:
// Direct scalar mappings
{ property: "id", how: "From prisma.id" }
{ property: "email", how: "From prisma.email" }
{ property: "createdAt", how: "From prisma.created_at.toISOString()" }
// Type conversions
{ property: "price", how: "From prisma.unit_price (Decimal → Number)" }
{ property: "deletedAt", how: "From prisma.deleted_at?.toISOString() ?? null" }
// Computed properties
{ property: "totalPrice", how: "Compute: prisma.unit_price * prisma.quantity" }
{ property: "reviewCount", how: "From prisma._count.reviews" }
{ property: "isExpired", how: "Compute: prisma.expiry_date < new Date()" }
// Nested transformations
{ property: "customer", how: "Transform with CustomerTransformer" }
{ property: "tags", how: "Array map with TagTransformer" }
Single DTO property transformation mapping for the transform() function.
Documents how to transform Prisma payload data into each specific DTO property in the transform() function. This structured approach ensures complete DTO coverage by requiring explicit documentation for EVERY property
Purpose:
Usage Contexts:
The validator cross-checks mappings against the DTO type definition to ensure nothing is overlooked, rejecting incomplete mappings.
Critical Principle:
This mapping is ONLY for the transform() function - it documents how to build the DTO return object. The corresponding select() function requirements are documented separately in AutoBeRealizeTransformerSelectMapping.
Author
Samchon