Files
psp_api/src/modules/consumer/utils/mapConsumerWithLicense.util.ts
T

19 lines
377 B
TypeScript
Raw Normal View History

export default (consumer: any) => {
const { activation, ...rest } = consumer
return {
...rest,
fullname: `${rest?.first_name} ${rest?.last_name}`,
license_info: prepareLicenseInfo(activation),
}
}
function prepareLicenseInfo(latestLicense: any) {
if (!latestLicense) return null
const { license, ...rest } = latestLicense
return {
...rest,
}
}