Return calculated total acquisition cost basis from seller-scoped acquisition history responses.
This commit is contained in:
@@ -17,7 +17,11 @@ export function createAcquisitionService({ acquisitionRepository }) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async list({ sellerId }) {
|
async list({ sellerId }) {
|
||||||
return acquisitionRepository.listBySellerId(sellerId);
|
const acquisitions = await acquisitionRepository.listBySellerId(sellerId);
|
||||||
|
return acquisitions.map((acquisition) => ({
|
||||||
|
...acquisition,
|
||||||
|
costBasisMinor: calculateAcquisitionCostBasis(acquisition),
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user