feat(utils): autogenerates create and update methods when dto is provided (#6751)
what:
when you provide an optional create_dto or update_dto to the model factory types, the abstract service will generate a simple service method for the public services of the modules.
```
MoneyAmount: {
dto: PricingTypes.MoneyAmountDTO
create_dto: PricingTypes.CreateMoneyAmountDTO
}
```
In the above example, only a create method will be generated, but the update will be skipped.
This commit is contained in:
@@ -1218,6 +1218,11 @@ export interface IPricingModuleService extends IModuleService {
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO[]>
|
||||
|
||||
createMoneyAmounts(
|
||||
data: CreateMoneyAmountDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO>
|
||||
|
||||
/**
|
||||
* This method updates existing money amounts.
|
||||
*
|
||||
@@ -1248,6 +1253,11 @@ export interface IPricingModuleService extends IModuleService {
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO[]>
|
||||
|
||||
updateMoneyAmounts(
|
||||
data: UpdateMoneyAmountDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO>
|
||||
|
||||
/**
|
||||
* This method deletes money amounts by their IDs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user