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:
+12
-2
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsString } from 'class-validator'
|
||||
import { IsDateString, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
export class CreateBusinessActivitiesDto {
|
||||
@IsString()
|
||||
@@ -11,8 +11,18 @@ export class CreateBusinessActivitiesDto {
|
||||
economic_code: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({})
|
||||
@ApiProperty({ required: true })
|
||||
guild_id: string
|
||||
|
||||
@IsDateString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
license_starts_at: string
|
||||
|
||||
@IsDateString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
expires_at: string
|
||||
}
|
||||
|
||||
export class UpdateBusinessActivityDto extends PartialType(CreateBusinessActivitiesDto) {}
|
||||
|
||||
Reference in New Issue
Block a user