feat: add stock keeping units management

- Created migration to drop `type` column from `stock_keeping_units` table.
- Added `Guild` model to Prisma schema.
- Implemented `BusinessActivitiesQueryService` for querying business activities.
- Developed `GoodsSharedService` for handling goods creation and updates.
- Introduced DTOs for creating and updating stock keeping units.
- Created controller and service for managing stock keeping units.
- Implemented response DTOs for stock keeping units service.
- Established module for stock keeping units management.
This commit is contained in:
2026-05-07 20:30:24 +03:30
parent 658496320b
commit fbe7230865
77 changed files with 2065 additions and 1846 deletions
+4 -19
View File
@@ -1,7 +1,6 @@
import translates from '@/common/constants/translates/translates'
import { translateEnumValue } from '@/common/utils/enum-translator.util'
import {
AccountRole,
AccountStatus,
AccountType,
ApplicationPlatform,
@@ -14,8 +13,7 @@ import {
ConsumerType,
CustomerType,
GoodPricingModel,
LicenseStatus,
LicenseType,
InvoiceTemplateType,
PartnerRole,
PartnerStatus,
PaymentMethodType,
@@ -23,19 +21,13 @@ import {
POSStatus,
POSType,
ProviderRole,
ProviderStatus,
SKUGuildType,
TokenType,
TspProviderCustomerType,
TspProviderRequestType,
TspProviderResponseStatus,
TspProviderType,
UnitType,
UserStatus,
UserType,
} from '@/generated/prisma/enums'
import { Injectable } from '@nestjs/common'
import { GoldKarat } from 'common/enums/enums'
import { GoldKarat, TspProviderCustomerType } from 'common/enums/enums'
import { ResponseMapper } from 'common/response/response-mapper'
@Injectable()
@@ -57,23 +49,15 @@ export class EnumsService {
return {
PaymentMethodType: this.prepareData(PaymentMethodType, 'PaymentMethodType'),
GoldKarat: this.prepareData(GoldKarat, 'GoldKarat'),
UserStatus: this.prepareData(UserStatus, 'UserStatus'),
AccountRole: this.prepareData(AccountRole, 'AccountRole'),
AccountStatus: this.prepareData(AccountStatus, 'AccountStatus'),
POSStatus: this.prepareData(POSStatus, 'POSStatus'),
POSRole: this.prepareData(POSRole, 'POSRole'),
LicenseType: this.prepareData(LicenseType, 'LicenseType'),
LicenseStatus: this.prepareData(LicenseStatus, 'LicenseStatus'),
POSType: this.prepareData(POSType, 'POSType'),
UserType: this.prepareData(UserType, 'UserType'),
AccountType: this.prepareData(AccountType, 'AccountType'),
PartnerRole: this.prepareData(PartnerRole, 'PartnerRole'),
BusinessRole: this.prepareData(BusinessRole, 'BusinessRole'),
ComplexRole: this.prepareData(ComplexRole, 'ComplexRole'),
ProviderRole: this.prepareData(ProviderRole, 'ProviderRole'),
ProviderStatus: this.prepareData(ProviderStatus, 'ProviderStatus'),
TokenType: this.prepareData(TokenType, 'TokenType'),
UnitType: this.prepareData(UnitType, 'UnitType'),
GoodPricingModel: this.prepareData(GoodPricingModel, 'GoodPricingModel'),
ConsumerRole: this.prepareData(ConsumerRole, 'ConsumerRole'),
ConsumerStatus: this.prepareData(ConsumerStatus, 'ConsumerStatus'),
@@ -103,10 +87,11 @@ export class EnumsService {
'TspProviderCustomerType',
),
SKUGuildType: this.prepareData(SKUGuildType, 'SKUGuildType'),
InvoiceTemplateType: this.prepareData(InvoiceTemplateType, 'InvoiceTemplateType'),
}
}
getEnumValues(enumName: string) {
getEnumValues(enumName: keyof typeof translates.enums) {
const enums = this.getAllEnums()
return ResponseMapper.list(enums[enumName] || [])
}