@alevnyacow/nzmt 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/cli.js +4 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -522,7 +522,7 @@ function generateStores(lowerCase, upperCase, withEntityPreset) {
522
522
  "\t\t\t",
523
523
  "\t\t};",
524
524
  "\t},",
525
- `\ttoDetails: (source: Prisma.${upperCase}GetPayload<{ include: { } }>): Types['details'] => {`,
525
+ `\ttoDetails: (source: Prisma.${upperCase}GetPayload<{}>): Types['details'] => {`,
526
526
  "\t\treturn {",
527
527
  "\t\t\t",
528
528
  "\t\t};",
@@ -557,8 +557,7 @@ function generateStores(lowerCase, upperCase, withEntityPreset) {
557
557
  "",
558
558
  "\tdetails = this.method('details', async ({ filter }) => {",
559
559
  `\t\tconst details = await this.prismaClient.${lowerCase}.findUnique({`,
560
- "\t\t\twhere: mappers.toFindOnePayload(filter),",
561
- "\t\t\tinclude: {}",
560
+ "\t\t\twhere: mappers.toFindOnePayload(filter)",
562
561
  "\t\t})",
563
562
  "",
564
563
  "\t\tif (!details) {",
@@ -648,13 +647,13 @@ function generateEntity(upperCase) {
648
647
 
649
648
  const body = [
650
649
  "import z from 'zod'",
651
- `import { ValueObjects } from '@${config?.paths?.valueObjects}/identifier'`,
650
+ `import { Identifier } from '@${config?.paths?.valueObjects}/identifier'`,
652
651
  "",
653
652
  `export type ${upperCase}Model = z.infer<typeof ${upperCase}.schema>`,
654
653
  "",
655
654
  `export class ${upperCase} {`,
656
655
  "\tstatic schema = z.object({",
657
- "\t\tid: ValueObjects.Identifier.schema,",
656
+ "\t\tid: Identifier.schema,",
658
657
  fields.length ?
659
658
  fields.map(([fieldName, description]) => {
660
659
  return `\t\t${fieldName}: z.${description.split('.').join('().')}(),`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolder", "zod", "rest", "contract programming", "react-query", "ddd", "domain-driven"],
6
6
  "repository": {