feat: implement inventory, product brand, product category, product info, product, role, store, user, and vendor modules with CRUD operations
- Added Create and Update DTOs for Inventory, Product Brand, Product Category, Product Info, Product, Role, Store, User, and Vendor. - Implemented InventoriesController, ProductBrandsController, ProductCategoriesController, ProductInfoController, ProductsController, RolesController, StoresController, UsersController, and VendorsController with respective CRUD endpoints. - Developed InventoriesService, ProductBrandsService, ProductCategoriesService, ProductInfoService, ProductsService, RolesService, StoresService, UsersService, and VendorsService to handle business logic. - Created PrismaModule and PrismaService for database interactions using Prisma with MariaDB adapter. - Configured application with Swagger for API documentation and added global interceptors for logging and response mapping. - Established e2e testing setup with Jest for the application.
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
import { VersioningType } from '@nestjs/common'
|
||||
import { NestFactory } from '@nestjs/core'
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
|
||||
import { AppModule } from './app.module'
|
||||
import { LoggingInterceptor } from './common/interceptors/logging.interceptor'
|
||||
import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor'
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule)
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Pos')
|
||||
.setDescription('The Pos API description')
|
||||
.setVersion('1.0')
|
||||
.addTag('pos')
|
||||
.build()
|
||||
const documentFactory = () => SwaggerModule.createDocument(app, config)
|
||||
SwaggerModule.setup('swagger', app, documentFactory)
|
||||
|
||||
// Set API prefix and enable URI versioning so all routes live under /api/v1/*
|
||||
app.setGlobalPrefix('api')
|
||||
app.enableVersioning({
|
||||
type: VersioningType.URI,
|
||||
defaultVersion: '1',
|
||||
})
|
||||
|
||||
// Register global logging and response mapping interceptors
|
||||
app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor())
|
||||
|
||||
await app.listen(process.env.PORT ?? 3000)
|
||||
}
|
||||
bootstrap()
|
||||
Reference in New Issue
Block a user