SpartanX1 / nestjs-files

Visual Studio code extension to quickly create NestJS Files
https://marketplace.visualstudio.com/items?itemName=AbhijoyBasak.nestjs-files
MIT License
14 stars 7 forks source link

Add a support to create a service of type repository. #1

Closed kedar9444 closed 4 years ago

kedar9444 commented 4 years ago

This will help the users to create a special type of service which will at as a repository. Many users would love to have it because standard patterns always keep your business logic and repository code in separate files.

feature request

kedar9444 commented 4 years ago

I have already written code for the same, not able to test it on local due to some buffer issue, will generate pr in some time.

SpartanX1 commented 4 years ago

Hi @kedar9444 , First of all thanks for the request! I went through your PR , and here are my thoughts.

  1. The command generate repository service so far only changes the class name which may be achieved through the generate service command itself, for eg providing the name "CatRepository" would generate the "CatRepositoryService" which may be enough

  2. Repository definition may differ based on which orm user is using. Maybe you can add a command instead for generating a typeorm repository class with entity decorators ?

SpartanX1 commented 4 years ago

https://github.com/typeorm/typeorm/blob/master/docs/active-record-data-mapper.md