mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 00:38:11 +00:00
fix(rates): render stored rate currency, default last mile to birr
The rate matrix currency cell hardcoded USD, so a last-mile rate priced in ETB still displayed as dollars. formatCell now takes the row and reads its currency code, falling back to USD. Last-mile currency select gets defaultValue ETB (new generic FormFieldDef.defaultValue for create-time pre-selection) and lists ETB (Birr) first; USD stays selectable. Backend already persisted and validated the chosen currency.
This commit is contained in:
@@ -43,6 +43,12 @@ export class YardsRepository implements IYardsRepository {
|
||||
findPaged(query: ListYardsQueryDto): Promise<PaginatedResponse<Yard>> {
|
||||
const qb = this.repo
|
||||
.createQueryBuilder('yard')
|
||||
// createQueryBuilder does NOT auto-apply the soft-delete filter that
|
||||
// repo.find()/findOne() get for free — without this, a renamed/replaced
|
||||
// yard (e.g. an old "DMP" superseded by a new one) still shows up
|
||||
// alongside the live one in every picker built off this endpoint, and a
|
||||
// route picked against the dead yard id never matches any LIVE rate.
|
||||
.where('yard.deleted_at IS NULL')
|
||||
.orderBy(`yard.${query.sortBy ?? 'displayOrder'}`, query.sortOrder ?? 'ASC')
|
||||
.addOrderBy('yard.label', 'ASC');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user