feat: implement supplier management module with create, update, find, and delete functionalities

- Added CreateSupplierDto for supplier creation
- Added UpdateSupplierDto for supplier updates
- Implemented SuppliersController to handle HTTP requests for suppliers
- Created SuppliersService to manage supplier data using Prisma
- Integrated SuppliersModule to encapsulate suppliers-related components
This commit is contained in:
2025-12-05 00:01:44 +03:30
parent 621e15dd02
commit 7cb9d7d037
20 changed files with 1762 additions and 1703 deletions
+16
View File
@@ -24,6 +24,22 @@ async function bootstrap() {
defaultVersion: '1',
})
// Enable CORS. You can set `CORS_ORIGINS` to a comma-separated list of allowed origins.
// Defaults include common localhost origins used by front-end dev servers.
const defaultOrigins = ['http://localhost:3001']
const envOrigins = process.env.CORS_ORIGINS
? process.env.CORS_ORIGINS.split(',')
.map(s => s.trim())
.filter(Boolean)
: []
const allowedOrigins = envOrigins.length ? envOrigins : defaultOrigins
app.enableCors({
origin: allowedOrigins,
credentials: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
allowedHeaders: 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token',
})
// Register global logging and response mapping interceptors
app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor())