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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user