Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup prisma-json-types-generator #2445

Open
3 tasks
dtslvr opened this issue Oct 7, 2023 · 0 comments · May be fixed by #2218
Open
3 tasks

Setup prisma-json-types-generator #2445

dtslvr opened this issue Oct 7, 2023 · 0 comments · May be fixed by #2218
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@dtslvr
Copy link
Member

dtslvr commented Oct 7, 2023

With the Prisma Json Types Generator, json types should be generated into the ones specified.

Current implementation

const scraperConfiguration = symbolProfile.scraperConfiguration as Prisma.JsonObject;

...

return {
   defaultMarketPrice: scraperConfiguration.defaultMarketPrice as number,
   headers: scraperConfiguration.headers as ScraperConfiguration['headers'],
   selector: scraperConfiguration.selector as string,
   url: scraperConfiguration.url as string
}

scraperConfiguration needs to be casted heavily in the SymbolProfileService.

New implementation

const scraperConfiguration = symbolProfile.scraperConfiguration;

scraperConfiguration should automatically have the type ScraperConfiguration from @prisma/client.

Todo

  • Build on top of the existing PR with the initial setup (Setup prisma-json-types-generator #2218)
  • Find solution for ERROR in ./apps/api/src/json-types.ts:1:9 TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
  • Eliminate ScraperConfiguration interface
@dtslvr dtslvr added enhancement New feature or request help wanted Extra attention is needed hacktoberfest labels Oct 7, 2023
@dtslvr dtslvr linked a pull request Oct 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant