feat: add consumer accounts and business activities management

- Implemented AccountsService for managing consumer accounts including create, update, delete, and find operations.
- Created DTOs for account creation and updates.
- Developed BusinessActivitiesController and BusinessActivitiesService for handling business activities related to consumers.
- Added complexes management with ComplexesController and ComplexesService.
- Introduced POS management with ComplexPosesController and ComplexPosesService.
- Created necessary DTOs for business activities and POS.
- Established Licenses management with LicensesController and LicensesService.
- Integrated consumer management with PartnerConsumersController and PartnerConsumersService.
- Added Prisma module imports and service connections across modules.
This commit is contained in:
2026-04-23 20:59:39 +03:30
parent f9e1ad69dc
commit a350ec7990
104 changed files with 13233 additions and 4105 deletions
-21
View File
@@ -18,27 +18,6 @@ export class ConsumerService {
last_name: true,
mobile_number: true,
status: true,
activated_licenses: {
select: {
id: true,
starts_at: true,
expires_at: true,
license: {
select: {
id: true,
charged_license_transaction: {
select: {
partner: {
select: {
name: true,
},
},
},
},
},
},
},
},
},
})
@@ -1,26 +1,10 @@
export default (consumer: any) => {
const { activated_licenses, ...rest } = consumer
let lastLicense: any = null
if (consumer.activated_licenses.length) {
lastLicense = consumer.activated_licenses[0]
if (consumer.activated_licenses.length > 1) {
const activeLicenseInfo = consumer.activated_licenses.find(
activated_license => activated_license.expires_at,
)
if (!activeLicenseInfo) {
consumer.activated_licenses.sort((a, b) => (a.expires_at > b.expires_at ? 1 : -1))
lastLicense = consumer.activated_licenses[0]
}
}
}
const { activation, ...rest } = consumer
return {
...rest,
fullname: `${rest?.first_name} ${rest?.last_name}`,
license_info: prepareLicenseInfo(lastLicense),
license_info: prepareLicenseInfo(activation),
}
}
@@ -30,6 +14,5 @@ function prepareLicenseInfo(latestLicense: any) {
return {
...rest,
partner: license.charged_license_transaction.partner,
}
}