feat(partners): add utility functions for partner business activity allocation limits and remaining licenses

- Implemented `getPartnerBusinessActivityAllocationLimits` to retrieve allocation limits for a partner's business activity.
- Added `ensurePartnerBusinessActivityHasRemainingAllocation` to validate remaining allocation credits.
- Created `getPartnerRemainingLicenses` to count remaining licenses for a partner.
- Developed `getPartnerFirstRemainingLicense` to fetch the first unused license for a partner.
- Introduced `ensurePartnerHasRemainingLicense` to ensure a partner has at least one unused license.
This commit is contained in:
2026-04-24 23:02:05 +03:30
parent 9b652a3603
commit 12506de863
43 changed files with 4645 additions and 2196 deletions
+14 -9
View File
@@ -89,6 +89,11 @@ export type DeviceBrand = Prisma.DeviceBrandModel
*
*/
export type Device = Prisma.DeviceModel
/**
* Model LicenseChargeTransaction
*
*/
export type LicenseChargeTransaction = Prisma.LicenseChargeTransactionModel
/**
* Model License
*
@@ -100,30 +105,30 @@ export type License = Prisma.LicenseModel
*/
export type LicenseActivation = Prisma.LicenseActivationModel
/**
* Model LicenseChargeTransaction
* Model LicenseRenewChargeTransaction
*
*/
export type LicenseChargeTransaction = Prisma.LicenseChargeTransactionModel
export type LicenseRenewChargeTransaction = Prisma.LicenseRenewChargeTransactionModel
/**
* Model LicenseRenew
*
*/
export type LicenseRenew = Prisma.LicenseRenewModel
/**
* Model LicenseRenewChargeTransaction
*
*/
export type LicenseRenewChargeTransaction = Prisma.LicenseRenewChargeTransactionModel
/**
* Model PartnerAccountQuotaChargeTransaction
*
*/
export type PartnerAccountQuotaChargeTransaction = Prisma.PartnerAccountQuotaChargeTransactionModel
/**
* Model PartnerAccountQuotaAllocation
* Model PartnerAccountQuotaCredit
*
*/
export type PartnerAccountQuotaAllocation = Prisma.PartnerAccountQuotaAllocationModel
export type PartnerAccountQuotaCredit = Prisma.PartnerAccountQuotaCreditModel
/**
* Model LicenseAccountAllocation
*
*/
export type LicenseAccountAllocation = Prisma.LicenseAccountAllocationModel
/**
* Model PartnerAccount
*