fix(SPG-645) Button generate price belum berfungsi
parent
9cd50ad817
commit
66c481c9b0
|
@ -6,7 +6,7 @@ import {
|
||||||
Param,
|
Param,
|
||||||
RelationParam,
|
RelationParam,
|
||||||
} from 'src/core/modules/domain/entities/base-filter.entity';
|
} from 'src/core/modules/domain/entities/base-filter.entity';
|
||||||
import { STATUS } from 'src/core/strings/constants/base.constants';
|
import { DAY, STATUS } from 'src/core/strings/constants/base.constants';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CurrentSeasonPeriodManager extends BaseIndexManager<SeasonPeriodEntity> {
|
export class CurrentSeasonPeriodManager extends BaseIndexManager<SeasonPeriodEntity> {
|
||||||
|
@ -20,8 +20,19 @@ export class CurrentSeasonPeriodManager extends BaseIndexManager<SeasonPeriodEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
async afterProcess(): Promise<void> {
|
async afterProcess(): Promise<void> {
|
||||||
|
const date = new Date(this.filterParam.date);
|
||||||
|
const day = DAY[date.getDay()];
|
||||||
Object.assign(this.result, {
|
Object.assign(this.result, {
|
||||||
data: this.result.data.sort((a, b) => a.priority - b.priority),
|
data: this.result.data
|
||||||
|
.filter((data) => {
|
||||||
|
const days: string[] = data.days ?? [];
|
||||||
|
if (data.priority == 2) {
|
||||||
|
return days.includes(day);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.sort((a, b) => a.priority - b.priority),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue