fix(SPG-592) Pemesanan - List Item - Saat update data tidak tersimpan
parent
4aa03226de
commit
1cd933d64f
|
@ -8,6 +8,7 @@ import {
|
|||
columnUniques,
|
||||
validateRelations,
|
||||
} from 'src/core/strings/constants/interface.constants';
|
||||
import { TransactionType } from '../../../constants';
|
||||
|
||||
@Injectable()
|
||||
export class UpdateTransactionManager extends BaseUpdateManager<TransactionEntity> {
|
||||
|
@ -16,6 +17,29 @@ export class UpdateTransactionManager extends BaseUpdateManager<TransactionEntit
|
|||
}
|
||||
|
||||
async beforeProcess(): Promise<void> {
|
||||
Object.assign(this.data, {
|
||||
type: TransactionType.ADMIN,
|
||||
customer_category_id: this.data.customer_category?.id ?? null,
|
||||
customer_category_name: this.data.customer_category?.name ?? null,
|
||||
season_period_id: this.data.season_period?.id ?? null,
|
||||
season_period_name: this.data.season_period?.holiday_name ?? null,
|
||||
season_period_type_id: this.data.season_period?.season_type?.id ?? null,
|
||||
season_period_type_name:
|
||||
this.data.season_period?.season_type?.name ?? null,
|
||||
});
|
||||
|
||||
this.data.items?.map((item) => {
|
||||
Object.assign(item, {
|
||||
item_id: item.item.id,
|
||||
item_name: item.item.name,
|
||||
item_type: item.item.item_type,
|
||||
item_price: item.item.base_price,
|
||||
item_tenant_id: item.item.tenant?.id ?? null,
|
||||
item_tenant_name: item.item.tenant?.id ?? null,
|
||||
item_tenant_percentage: item.item.tenant?.share_margin ?? null,
|
||||
});
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue