<h1>Create Crud Module from existing module</h1>
<ol>
    <li>Copy any existing module which is similar as the module you want to create</li>
    <li>Rename folder as <code>module-name</code> For example, your tables name is user_corporate_info then your moudle folder name is <code>user-corporate-info</code></li>
    <li>
        <p>Rename all below files as <code>module.name</code></p>
        <ol>
            <li><code>dto/user.corporate.info.dto.ts</code></li>
            <li><code>entity/user.corporate.info.entity.ts</code></li>
            <li><code>user.corporate.info.resolver.ts</code></li>
            <li><code>user.corporate.info.crud.factory.ts</code></li>
            <li ><code>user.corporate.info.service.ts</code></li>
            <li><code>user.corporate.info.module.ts</code></li>
        </ol>
    </li>
    <li>Now, open all files and remove unwanted contents for ex: foregin key relations or any other imported module which is not required in this module</li>
    <li>Now, we need to replace all required contents from all the files</li>
    <li><p> Follow below steps for all the files. Use Find and replace for all files with <code>Match case</code> enabled</p>
        <ol>
            <li>Search <code>[user/.]</code> and replace with <code>[user.corporte.info/.]</code></li>
            <li>Search <code>[user]</code> and replace with <code>[usercorporateinfo]</code></li>
            <li>Search <code>[User]</code> and replace with <code>[UserCorporateInfo]</code></li>
        </ol>
    </li>
    <li>Now, start to change entity and dto file.</li>
    <li>
        <p>Below is the document refrences to create Entity field and grahql field</p>
        <ol>
            <li><a href="https://docs.nestjs.com/techniques/graphql">https://docs.nestjs.com/techniques/graphql</a></li>
            <li><a href="https://docs.nestjs.com/graphql/quick-start">https://docs.nestjs.com/graphql/quick-start</a></li>
            <li><a href="https://typeorm.io/entities">https://typeorm.io/entities</a></li>
            <li><a href="https://the-guild.dev/graphql/scalars/docs">https://the-guild.dev/graphql/scalars/docs</a></li>
        </ol>
    </li>
    <li><p>First, start work with entity file</p>
        <ol>
            <li>Change <code>[columnPrefix]</code> as per the field prefix</li>
            <li>Copy all fields from the database tabel and set in commented code</li>
            <li>Remove column prefix from <code>`[columnPrefix]</code> to none</li>
            <li>Remove <code>`,</code> to <code>?: any;</code></li>
            <li>Find and replace manully for the above 3rd and 4th point</li>
            <li>change in const <code>[Module.name]EntityFieldMeta</code> set desc and validation as per the table columns</li>
            <li>Make sure the entity name means table name has changed properly if not then change as per database table name</li>
            <li>Change in [Module.name]Entity class as  per the requirement of table fields</li>
            <li><p>Now, start to change dto file. Follow below steps</p>
                <ol>
                    <li>Change 2 file names in comment ['../entities/user.entity', './dto/user.dto'] . perform find replce generally </li>
                    <li>When you change file path, make sure you do not break some dependences which required this class, by find and replce path this is common issue this need to handle manually</li>
                    <li>Go to defination [FindInputDtoCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [FindInputWhereCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [FindInputSortOrderCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [FindInputGroupByCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [FindOutputRowsCRUDTypeDefinition], just search and you will be there. By default this will inhereate ENTITY and if you need change, just set field list as per new module entity class.</li>
                    <li>Go to defination [FindOutputCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [CreateInputCRUDTypeDefinition], just search and you will be there. Set field list as per new module entity class.</li>
                    <li>Go to defination [conflictResolveFields], need to change in code line { static conflictResolveFields: (keyof ApiEndpointAuthUpsertInput)[] = ['CHANGE_FIELD(S)']; }</li>
                    <li>Make sure [FindOutputPagination] is imported from '@libs/library-app' (real location: /libs/library-app/src/crud/dto/standard/crud.pagination.dto)</li>
                </ol>
            </li>
        </ol>
    </li>
    <li>Now, Finally setup the Foregn key relations</li>
    
</ol>