55b96d4f79
- Removed global validation pipe and added a new ValidationExceptionFilter for better error handling. - Refactored controller routes to use underscores instead of hyphens for consistency. - Updated CreateSalesInvoiceItemDto to include new fields: quantity, unit_type, and payload. - Modified CreateSalesInvoiceDto to enforce items as an array with a minimum size. - Added Enums module to provide gold karat values through a dedicated endpoint. - Introduced new columns in the database schema for sales invoice items and goods.
18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import { Injectable } from '@nestjs/common'
|
|
import { GoldKarat } from '../../common/enums/enums'
|
|
import { ResponseMapper } from '../../common/response/response-mapper'
|
|
|
|
@Injectable()
|
|
export class EnumsService {
|
|
getAllEnums() {
|
|
return {
|
|
GoldKarat: Object.values(GoldKarat).filter(value => typeof value === 'string'),
|
|
}
|
|
}
|
|
|
|
getEnumValues(enumName: string) {
|
|
const enums = this.getAllEnums()
|
|
return ResponseMapper.list(enums[enumName] || [])
|
|
}
|
|
}
|