@noatgnu/cupcake-salted-caramel 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable } from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
|
|
3
3
|
import { BaseApiService } from '@noatgnu/cupcake-core';
|
|
4
4
|
|
|
5
5
|
class CupcakeSaltedCaramel {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: CupcakeSaltedCaramel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: CupcakeSaltedCaramel, isStandalone: true, selector: "ccsc-cupcake-salted-caramel", ngImport: i0, template: `
|
|
8
8
|
<p>
|
|
9
9
|
cupcake-salted-caramel works!
|
|
10
10
|
</p>
|
|
11
|
-
`, isInline: true, styles: [""] });
|
|
11
|
+
`, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
12
12
|
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: CupcakeSaltedCaramel, decorators: [{
|
|
14
14
|
type: Component,
|
|
15
15
|
args: [{ selector: 'ccsc-cupcake-salted-caramel', imports: [], template: `
|
|
16
16
|
<p>
|
|
17
17
|
cupcake-salted-caramel works!
|
|
18
18
|
</p>
|
|
19
|
-
|
|
19
|
+
`, changeDetection: ChangeDetectionStrategy.Eager }]
|
|
20
20
|
}] });
|
|
21
21
|
|
|
22
22
|
var BillingUnit;
|
|
@@ -120,10 +120,10 @@ class ServiceTierService extends BaseApiService {
|
|
|
120
120
|
getServiceTiersByPriorityDesc() {
|
|
121
121
|
return this.getServiceTiers({ ordering: '-priority_level' });
|
|
122
122
|
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServiceTierService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServiceTierService, providedIn: 'root' });
|
|
125
125
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServiceTierService, decorators: [{
|
|
127
127
|
type: Injectable,
|
|
128
128
|
args: [{
|
|
129
129
|
providedIn: 'root'
|
|
@@ -229,10 +229,10 @@ class BillableItemTypeService extends BaseApiService {
|
|
|
229
229
|
getFlatRateBillingItemTypes() {
|
|
230
230
|
return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.FLAT });
|
|
231
231
|
}
|
|
232
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
233
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillableItemTypeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
233
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillableItemTypeService, providedIn: 'root' });
|
|
234
234
|
}
|
|
235
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillableItemTypeService, decorators: [{
|
|
236
236
|
type: Injectable,
|
|
237
237
|
args: [{
|
|
238
238
|
providedIn: 'root'
|
|
@@ -349,10 +349,10 @@ class ServicePriceService extends BaseApiService {
|
|
|
349
349
|
getFlatRateServicePrices() {
|
|
350
350
|
return this.getServicePrices({ billingUnit: BillingUnit.FLAT });
|
|
351
351
|
}
|
|
352
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
353
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
352
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServicePriceService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
353
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServicePriceService, providedIn: 'root' });
|
|
354
354
|
}
|
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ServicePriceService, decorators: [{
|
|
356
356
|
type: Injectable,
|
|
357
357
|
args: [{
|
|
358
358
|
providedIn: 'root'
|
|
@@ -426,7 +426,7 @@ class BillingRecordService extends BaseApiService {
|
|
|
426
426
|
* Get user billing records
|
|
427
427
|
*/
|
|
428
428
|
getUserBillingRecords(userId) {
|
|
429
|
-
return this.getBillingRecords({
|
|
429
|
+
return this.getBillingRecords({ userId });
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
432
432
|
* Get my billing records (current user)
|
|
@@ -503,13 +503,13 @@ class BillingRecordService extends BaseApiService {
|
|
|
503
503
|
/**
|
|
504
504
|
* Get billing records for date range
|
|
505
505
|
*/
|
|
506
|
-
getBillingRecordsByDateRange(
|
|
507
|
-
return this.getBillingRecords({
|
|
506
|
+
getBillingRecordsByDateRange(startDate, endDate) {
|
|
507
|
+
return this.getBillingRecords({ startDate, endDate });
|
|
508
508
|
}
|
|
509
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
510
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillingRecordService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
510
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillingRecordService, providedIn: 'root' });
|
|
511
511
|
}
|
|
512
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BillingRecordService, decorators: [{
|
|
513
513
|
type: Injectable,
|
|
514
514
|
args: [{
|
|
515
515
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noatgnu-cupcake-salted-caramel.mjs","sources":["../../../projects/cupcake-salted-caramel/src/lib/cupcake-salted-caramel.ts","../../../projects/cupcake-salted-caramel/src/lib/models/enums.ts","../../../projects/cupcake-salted-caramel/src/lib/models/index.ts","../../../projects/cupcake-salted-caramel/src/lib/services/service-tier.ts","../../../projects/cupcake-salted-caramel/src/lib/services/billable-item-type.ts","../../../projects/cupcake-salted-caramel/src/lib/services/service-price.ts","../../../projects/cupcake-salted-caramel/src/lib/services/billing-record.ts","../../../projects/cupcake-salted-caramel/src/lib/services/index.ts","../../../projects/cupcake-salted-caramel/src/public-api.ts","../../../projects/cupcake-salted-caramel/src/noatgnu-cupcake-salted-caramel.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'ccsc-cupcake-salted-caramel',\n imports: [],\n template: `\n <p>\n cupcake-salted-caramel works!\n </p>\n `,\n styles: ``\n})\nexport class CupcakeSaltedCaramel {\n\n}\n","export enum BillingUnit {\n HOURLY = 'hourly',\n DAILY = 'daily',\n USAGE = 'usage',\n SAMPLE = 'sample',\n FLAT = 'flat',\n CUSTOM = 'custom'\n}\n\nexport enum BillingStatus {\n PENDING = 'pending',\n APPROVED = 'approved',\n BILLED = 'billed',\n PAID = 'paid',\n DISPUTED = 'disputed',\n CANCELLED = 'cancelled'\n}","// Base types and enums\nexport * from './base';\nexport * from './enums';\n\n// Billing models\nexport * from './billing';","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n ServiceTier,\n ServiceTierCreateRequest,\n ServiceTierUpdateRequest,\n PaginatedResponse\n} from '../models';\n\nexport interface ServiceTierQueryParams {\n search?: string;\n isActive?: boolean;\n priorityLevel?: number;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ServiceTierService extends BaseApiService {\n\n /**\n * Get all service tiers with optional filtering\n */\n getServiceTiers(params?: ServiceTierQueryParams): Observable<PaginatedResponse<ServiceTier>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<ServiceTier>>(`${this.apiUrl}/service-tiers/`, { params: httpParams });\n }\n\n /**\n * Get a single service tier by ID\n */\n getServiceTier(id: number): Observable<ServiceTier> {\n return this.get<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`);\n }\n\n /**\n * Create a new service tier\n */\n createServiceTier(tier: ServiceTierCreateRequest): Observable<ServiceTier> {\n return this.post<ServiceTier>(`${this.apiUrl}/service-tiers/`, tier);\n }\n\n /**\n * Update an existing service tier\n */\n updateServiceTier(id: number, tier: ServiceTierUpdateRequest): Observable<ServiceTier> {\n return this.put<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`, tier);\n }\n\n /**\n * Partially update a service tier\n */\n patchServiceTier(id: number, tier: Partial<ServiceTierUpdateRequest>): Observable<ServiceTier> {\n return this.patch<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`, tier);\n }\n\n /**\n * Delete a service tier\n */\n deleteServiceTier(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/service-tiers/${id}/`);\n }\n\n /**\n * Calculate price for a given base amount using tier's modifiers\n */\n calculatePrice(id: number, request: { baseAmount: number }): Observable<{ \n calculatedPrice: number; \n baseAmount: number; \n multiplier: number; \n discount: number \n }> {\n return this.post<{ \n calculatedPrice: number; \n baseAmount: number; \n multiplier: number; \n discount: number \n }>(`${this.apiUrl}/service-tiers/${id}/calculate_price/`, request);\n }\n\n /**\n * Get active service tiers (Django custom action)\n */\n getActiveTiers(): Observable<ServiceTier[]> {\n return this.get<ServiceTier[]>(`${this.apiUrl}/service-tiers/active_tiers/`);\n }\n\n /**\n * Search service tiers by name or description\n */\n searchServiceTiers(query: string): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ search: query });\n }\n\n /**\n * Get active service tiers only\n */\n getActiveServiceTiers(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ isActive: true });\n }\n\n /**\n * Get inactive service tiers\n */\n getInactiveServiceTiers(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ isActive: false });\n }\n\n /**\n * Get service tiers by priority level\n */\n getServiceTiersByPriority(priorityLevel: number): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ priorityLevel });\n }\n\n /**\n * Get service tiers ordered by priority (highest first)\n */\n getServiceTiersByPriorityDesc(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ ordering: '-priority_level' });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n BillableItemType,\n BillableItemTypeCreateRequest,\n BillableItemTypeUpdateRequest,\n BillingUnit,\n PaginatedResponse\n} from '../models';\n\nexport interface BillableItemTypeQueryParams {\n search?: string;\n isActive?: boolean;\n requiresApproval?: boolean;\n defaultBillingUnit?: BillingUnit;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BillableItemTypeService extends BaseApiService {\n\n /**\n * Get all billable item types with optional filtering\n */\n getBillableItemTypes(params?: BillableItemTypeQueryParams): Observable<PaginatedResponse<BillableItemType>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<BillableItemType>>(`${this.apiUrl}/billable-item-types/`, { params: httpParams });\n }\n\n /**\n * Get a single billable item type by ID\n */\n getBillableItemType(id: number): Observable<BillableItemType> {\n return this.get<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`);\n }\n\n /**\n * Create a new billable item type\n */\n createBillableItemType(itemType: BillableItemTypeCreateRequest): Observable<BillableItemType> {\n return this.post<BillableItemType>(`${this.apiUrl}/billable-item-types/`, itemType);\n }\n\n /**\n * Update an existing billable item type\n */\n updateBillableItemType(id: number, itemType: BillableItemTypeUpdateRequest): Observable<BillableItemType> {\n return this.put<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`, itemType);\n }\n\n /**\n * Partially update a billable item type\n */\n patchBillableItemType(id: number, itemType: Partial<BillableItemTypeUpdateRequest>): Observable<BillableItemType> {\n return this.patch<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`, itemType);\n }\n\n /**\n * Delete a billable item type\n */\n deleteBillableItemType(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/billable-item-types/${id}/`);\n }\n\n /**\n * Get billable item types grouped by content type (Django custom action)\n */\n getByContentType(appLabel?: string, model?: string): Observable<PaginatedResponse<BillableItemType>> {\n const params = this.buildHttpParams({ appLabel, model });\n return this.get<PaginatedResponse<BillableItemType>>(`${this.apiUrl}/billable-item-types/by_content_type/`, { params });\n }\n\n /**\n * Search billable item types by name or description\n */\n searchBillableItemTypes(query: string): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ search: query });\n }\n\n /**\n * Get active billable item types only\n */\n getActiveBillableItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ isActive: true });\n }\n\n /**\n * Get inactive billable item types\n */\n getInactiveBillableItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ isActive: false });\n }\n\n /**\n * Get billable item types that require approval\n */\n getApprovalRequiredItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ requiresApproval: true });\n }\n\n /**\n * Get billable item types that don't require approval\n */\n getAutoApprovedItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ requiresApproval: false });\n }\n\n /**\n * Get billable item types by billing unit\n */\n getBillableItemTypesByUnit(billingUnit: BillingUnit): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: billingUnit });\n }\n\n /**\n * Get hourly billing item types\n */\n getHourlyBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.HOURLY });\n }\n\n /**\n * Get usage-based billing item types\n */\n getUsageBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.USAGE });\n }\n\n /**\n * Get flat rate billing item types\n */\n getFlatRateBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.FLAT });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n ServicePrice,\n ServicePriceCreateRequest,\n ServicePriceUpdateRequest,\n ServicePriceCalculationRequest,\n CostBreakdown,\n BillingUnit,\n PaginatedResponse\n} from '../models';\n\nexport interface ServicePriceQueryParams {\n search?: string;\n isActive?: boolean;\n billingUnit?: BillingUnit;\n currency?: string;\n billableItemType?: number;\n serviceTier?: number;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ServicePriceService extends BaseApiService {\n\n /**\n * Get all service prices with optional filtering\n */\n getServicePrices(params?: ServicePriceQueryParams): Observable<PaginatedResponse<ServicePrice>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<ServicePrice>>(`${this.apiUrl}/service-prices/`, { params: httpParams });\n }\n\n /**\n * Get a single service price by ID\n */\n getServicePrice(id: number): Observable<ServicePrice> {\n return this.get<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`);\n }\n\n /**\n * Create a new service price\n */\n createServicePrice(price: ServicePriceCreateRequest): Observable<ServicePrice> {\n return this.post<ServicePrice>(`${this.apiUrl}/service-prices/`, price);\n }\n\n /**\n * Update an existing service price\n */\n updateServicePrice(id: number, price: ServicePriceUpdateRequest): Observable<ServicePrice> {\n return this.put<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`, price);\n }\n\n /**\n * Partially update a service price\n */\n patchServicePrice(id: number, price: Partial<ServicePriceUpdateRequest>): Observable<ServicePrice> {\n return this.patch<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`, price);\n }\n\n /**\n * Delete a service price\n */\n deleteServicePrice(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/service-prices/${id}/`);\n }\n\n /**\n * Calculate total cost for a given quantity\n */\n calculateCost(id: number, request: ServicePriceCalculationRequest): Observable<CostBreakdown> {\n return this.post<CostBreakdown>(`${this.apiUrl}/service-prices/${id}/calculate_cost/`, request);\n }\n\n /**\n * Get current effective prices (Django custom action)\n */\n getCurrentPrices(): Observable<ServicePrice[]> {\n return this.get<ServicePrice[]>(`${this.apiUrl}/service-prices/current_prices/`);\n }\n\n /**\n * Search service prices by item or tier name\n */\n searchServicePrices(query: string): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ search: query });\n }\n\n /**\n * Get active service prices only\n */\n getActiveServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ isActive: true });\n }\n\n /**\n * Get inactive service prices\n */\n getInactiveServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ isActive: false });\n }\n\n /**\n * Get service prices by billing unit\n */\n getServicePricesByUnit(billingUnit: BillingUnit): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit });\n }\n\n /**\n * Get service prices by currency\n */\n getServicePricesByCurrency(currency: string): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ currency });\n }\n\n /**\n * Get service prices for a specific billable item type\n */\n getServicePricesForItemType(itemTypeId: number): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billableItemType: itemTypeId });\n }\n\n /**\n * Get service prices for a specific service tier\n */\n getServicePricesForTier(tierId: number): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ serviceTier: tierId });\n }\n\n /**\n * Get hourly service prices\n */\n getHourlyServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.HOURLY });\n }\n\n /**\n * Get usage-based service prices\n */\n getUsageServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.USAGE });\n }\n\n /**\n * Get flat rate service prices\n */\n getFlatRateServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.FLAT });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n BillingRecord,\n BillingRecordCreateRequest,\n BillingRecordUpdateRequest,\n BillingRecordSummary,\n BillingApprovalRequest,\n BillingStatus,\n PaginatedResponse\n} from '../models';\n\nexport interface BillingRecordQueryParams {\n search?: string;\n status?: BillingStatus;\n currency?: string;\n costCenter?: string;\n user?: number;\n serviceTier?: number;\n dateFrom?: string;\n dateTo?: string;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BillingRecordService extends BaseApiService {\n\n /**\n * Get all billing records with optional filtering\n */\n getBillingRecords(params?: BillingRecordQueryParams): Observable<PaginatedResponse<BillingRecord>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<BillingRecord>>(`${this.apiUrl}/billing-records/`, { params: httpParams });\n }\n\n /**\n * Get a single billing record by ID\n */\n getBillingRecord(id: string): Observable<BillingRecord> {\n return this.get<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`);\n }\n\n /**\n * Create a new billing record\n */\n createBillingRecord(record: BillingRecordCreateRequest): Observable<BillingRecord> {\n return this.post<BillingRecord>(`${this.apiUrl}/billing-records/`, record);\n }\n\n /**\n * Update an existing billing record\n */\n updateBillingRecord(id: string, record: BillingRecordUpdateRequest): Observable<BillingRecord> {\n return this.put<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`, record);\n }\n\n /**\n * Partially update a billing record\n */\n patchBillingRecord(id: string, record: Partial<BillingRecordUpdateRequest>): Observable<BillingRecord> {\n return this.patch<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`, record);\n }\n\n /**\n * Delete a billing record\n */\n deleteBillingRecord(id: string): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/billing-records/${id}/`);\n }\n\n /**\n * Approve a billing record\n */\n approveBillingRecord(id: string, request: BillingApprovalRequest): Observable<BillingRecord> {\n return this.post<BillingRecord>(`${this.apiUrl}/billing-records/${id}/approve/`, request);\n }\n\n\n /**\n * Get billing summary statistics (Django custom action)\n */\n getSummary(params?: { \n dateFrom?: string; \n dateTo?: string; \n currency?: string;\n costCenter?: string;\n serviceTier?: number;\n }): Observable<BillingRecordSummary> {\n const httpParams = this.buildHttpParams(params);\n return this.get<BillingRecordSummary>(`${this.apiUrl}/billing-records/summary/`, { params: httpParams });\n }\n\n /**\n * Get billing records pending approval (Django custom action)\n */\n getPendingApproval(): Observable<PaginatedResponse<BillingRecord>> {\n return this.get<PaginatedResponse<BillingRecord>>(`${this.apiUrl}/billing-records/pending_approval/`);\n }\n\n /**\n * Get billing records grouped by cost center (Django custom action)\n */\n getByCostCenter(): Observable<{ [key: string]: BillingRecord[] }> {\n return this.get<{ [key: string]: BillingRecord[] }>(`${this.apiUrl}/billing-records/by_cost_center/`);\n }\n\n /**\n * Get user billing records\n */\n getUserBillingRecords(userId: number): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ user: userId });\n }\n\n /**\n * Get my billing records (current user)\n */\n getMyBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.get<PaginatedResponse<BillingRecord>>(`${this.apiUrl}/billing-records/my_records/`);\n }\n\n /**\n * Search billing records by description, notes, or cost center\n */\n searchBillingRecords(query: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ search: query });\n }\n\n /**\n * Get pending billing records\n */\n getPendingBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.PENDING });\n }\n\n /**\n * Get approved billing records\n */\n getApprovedBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.APPROVED });\n }\n\n /**\n * Get billed billing records\n */\n getBilledBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.BILLED });\n }\n\n /**\n * Get paid billing records\n */\n getPaidBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.PAID });\n }\n\n /**\n * Get disputed billing records\n */\n getDisputedBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.DISPUTED });\n }\n\n /**\n * Get cancelled billing records\n */\n getCancelledBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.CANCELLED });\n }\n\n /**\n * Get billing records by status\n */\n getBillingRecordsByStatus(status: BillingStatus): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status });\n }\n\n /**\n * Get billing records by currency\n */\n getBillingRecordsByCurrency(currency: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ currency });\n }\n\n /**\n * Get billing records by cost center\n */\n getBillingRecordsByCostCenter(costCenter: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ costCenter });\n }\n\n /**\n * Get billing records by service tier\n */\n getBillingRecordsByServiceTier(tierId: number): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ serviceTier: tierId });\n }\n\n /**\n * Get billing records for date range\n */\n getBillingRecordsByDateRange(dateFrom: string, dateTo: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ dateFrom, dateTo });\n }\n\n}","// Billing and financial management services\nexport * from './service-tier';\nexport * from './billable-item-type';\nexport * from './service-price';\nexport * from './billing-record';","/*\n * Public API Surface of cupcake-salted-caramel\n */\n\nexport * from './lib/cupcake-salted-caramel';\n\nexport * from './lib/models';\nexport * from './lib/services';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,oBAAoB,CAAA;wGAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAPrB;;;;AAIT,EAAA,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AA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA;;4FAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;AC9BD;;ACAA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"noatgnu-cupcake-salted-caramel.mjs","sources":["../../../projects/cupcake-salted-caramel/src/lib/cupcake-salted-caramel.ts","../../../projects/cupcake-salted-caramel/src/lib/models/enums.ts","../../../projects/cupcake-salted-caramel/src/lib/models/index.ts","../../../projects/cupcake-salted-caramel/src/lib/services/service-tier.ts","../../../projects/cupcake-salted-caramel/src/lib/services/billable-item-type.ts","../../../projects/cupcake-salted-caramel/src/lib/services/service-price.ts","../../../projects/cupcake-salted-caramel/src/lib/services/billing-record.ts","../../../projects/cupcake-salted-caramel/src/lib/services/index.ts","../../../projects/cupcake-salted-caramel/src/public-api.ts","../../../projects/cupcake-salted-caramel/src/noatgnu-cupcake-salted-caramel.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'ccsc-cupcake-salted-caramel',\n imports: [],\n template: `\n <p>\n cupcake-salted-caramel works!\n </p>\n `,\n changeDetection: ChangeDetectionStrategy.Eager,\n styles: ``\n})\nexport class CupcakeSaltedCaramel {\n\n}\n","export enum BillingUnit {\n HOURLY = 'hourly',\n DAILY = 'daily',\n USAGE = 'usage',\n SAMPLE = 'sample',\n FLAT = 'flat',\n CUSTOM = 'custom'\n}\n\nexport enum BillingStatus {\n PENDING = 'pending',\n APPROVED = 'approved',\n BILLED = 'billed',\n PAID = 'paid',\n DISPUTED = 'disputed',\n CANCELLED = 'cancelled'\n}","// Base types and enums\nexport * from './base';\nexport * from './enums';\n\n// Billing models\nexport * from './billing';","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n ServiceTier,\n ServiceTierCreateRequest,\n ServiceTierUpdateRequest,\n PaginatedResponse\n} from '../models';\n\nexport interface ServiceTierQueryParams {\n search?: string;\n isActive?: boolean;\n priorityLevel?: number;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ServiceTierService extends BaseApiService {\n\n /**\n * Get all service tiers with optional filtering\n */\n getServiceTiers(params?: ServiceTierQueryParams): Observable<PaginatedResponse<ServiceTier>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<ServiceTier>>(`${this.apiUrl}/service-tiers/`, { params: httpParams });\n }\n\n /**\n * Get a single service tier by ID\n */\n getServiceTier(id: number): Observable<ServiceTier> {\n return this.get<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`);\n }\n\n /**\n * Create a new service tier\n */\n createServiceTier(tier: ServiceTierCreateRequest): Observable<ServiceTier> {\n return this.post<ServiceTier>(`${this.apiUrl}/service-tiers/`, tier);\n }\n\n /**\n * Update an existing service tier\n */\n updateServiceTier(id: number, tier: ServiceTierUpdateRequest): Observable<ServiceTier> {\n return this.put<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`, tier);\n }\n\n /**\n * Partially update a service tier\n */\n patchServiceTier(id: number, tier: Partial<ServiceTierUpdateRequest>): Observable<ServiceTier> {\n return this.patch<ServiceTier>(`${this.apiUrl}/service-tiers/${id}/`, tier);\n }\n\n /**\n * Delete a service tier\n */\n deleteServiceTier(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/service-tiers/${id}/`);\n }\n\n /**\n * Calculate price for a given base amount using tier's modifiers\n */\n calculatePrice(id: number, request: { baseAmount: number }): Observable<{ \n calculatedPrice: number; \n baseAmount: number; \n multiplier: number; \n discount: number \n }> {\n return this.post<{ \n calculatedPrice: number; \n baseAmount: number; \n multiplier: number; \n discount: number \n }>(`${this.apiUrl}/service-tiers/${id}/calculate_price/`, request);\n }\n\n /**\n * Get active service tiers (Django custom action)\n */\n getActiveTiers(): Observable<ServiceTier[]> {\n return this.get<ServiceTier[]>(`${this.apiUrl}/service-tiers/active_tiers/`);\n }\n\n /**\n * Search service tiers by name or description\n */\n searchServiceTiers(query: string): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ search: query });\n }\n\n /**\n * Get active service tiers only\n */\n getActiveServiceTiers(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ isActive: true });\n }\n\n /**\n * Get inactive service tiers\n */\n getInactiveServiceTiers(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ isActive: false });\n }\n\n /**\n * Get service tiers by priority level\n */\n getServiceTiersByPriority(priorityLevel: number): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ priorityLevel });\n }\n\n /**\n * Get service tiers ordered by priority (highest first)\n */\n getServiceTiersByPriorityDesc(): Observable<PaginatedResponse<ServiceTier>> {\n return this.getServiceTiers({ ordering: '-priority_level' });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n BillableItemType,\n BillableItemTypeCreateRequest,\n BillableItemTypeUpdateRequest,\n BillingUnit,\n PaginatedResponse\n} from '../models';\n\nexport interface BillableItemTypeQueryParams {\n search?: string;\n isActive?: boolean;\n requiresApproval?: boolean;\n defaultBillingUnit?: BillingUnit;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BillableItemTypeService extends BaseApiService {\n\n /**\n * Get all billable item types with optional filtering\n */\n getBillableItemTypes(params?: BillableItemTypeQueryParams): Observable<PaginatedResponse<BillableItemType>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<BillableItemType>>(`${this.apiUrl}/billable-item-types/`, { params: httpParams });\n }\n\n /**\n * Get a single billable item type by ID\n */\n getBillableItemType(id: number): Observable<BillableItemType> {\n return this.get<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`);\n }\n\n /**\n * Create a new billable item type\n */\n createBillableItemType(itemType: BillableItemTypeCreateRequest): Observable<BillableItemType> {\n return this.post<BillableItemType>(`${this.apiUrl}/billable-item-types/`, itemType);\n }\n\n /**\n * Update an existing billable item type\n */\n updateBillableItemType(id: number, itemType: BillableItemTypeUpdateRequest): Observable<BillableItemType> {\n return this.put<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`, itemType);\n }\n\n /**\n * Partially update a billable item type\n */\n patchBillableItemType(id: number, itemType: Partial<BillableItemTypeUpdateRequest>): Observable<BillableItemType> {\n return this.patch<BillableItemType>(`${this.apiUrl}/billable-item-types/${id}/`, itemType);\n }\n\n /**\n * Delete a billable item type\n */\n deleteBillableItemType(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/billable-item-types/${id}/`);\n }\n\n /**\n * Get billable item types grouped by content type (Django custom action)\n */\n getByContentType(appLabel?: string, model?: string): Observable<PaginatedResponse<BillableItemType>> {\n const params = this.buildHttpParams({ appLabel, model });\n return this.get<PaginatedResponse<BillableItemType>>(`${this.apiUrl}/billable-item-types/by_content_type/`, { params });\n }\n\n /**\n * Search billable item types by name or description\n */\n searchBillableItemTypes(query: string): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ search: query });\n }\n\n /**\n * Get active billable item types only\n */\n getActiveBillableItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ isActive: true });\n }\n\n /**\n * Get inactive billable item types\n */\n getInactiveBillableItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ isActive: false });\n }\n\n /**\n * Get billable item types that require approval\n */\n getApprovalRequiredItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ requiresApproval: true });\n }\n\n /**\n * Get billable item types that don't require approval\n */\n getAutoApprovedItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ requiresApproval: false });\n }\n\n /**\n * Get billable item types by billing unit\n */\n getBillableItemTypesByUnit(billingUnit: BillingUnit): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: billingUnit });\n }\n\n /**\n * Get hourly billing item types\n */\n getHourlyBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.HOURLY });\n }\n\n /**\n * Get usage-based billing item types\n */\n getUsageBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.USAGE });\n }\n\n /**\n * Get flat rate billing item types\n */\n getFlatRateBillingItemTypes(): Observable<PaginatedResponse<BillableItemType>> {\n return this.getBillableItemTypes({ defaultBillingUnit: BillingUnit.FLAT });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n ServicePrice,\n ServicePriceCreateRequest,\n ServicePriceUpdateRequest,\n ServicePriceCalculationRequest,\n CostBreakdown,\n BillingUnit,\n PaginatedResponse\n} from '../models';\n\nexport interface ServicePriceQueryParams {\n search?: string;\n isActive?: boolean;\n billingUnit?: BillingUnit;\n currency?: string;\n billableItemType?: number;\n serviceTier?: number;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ServicePriceService extends BaseApiService {\n\n /**\n * Get all service prices with optional filtering\n */\n getServicePrices(params?: ServicePriceQueryParams): Observable<PaginatedResponse<ServicePrice>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<ServicePrice>>(`${this.apiUrl}/service-prices/`, { params: httpParams });\n }\n\n /**\n * Get a single service price by ID\n */\n getServicePrice(id: number): Observable<ServicePrice> {\n return this.get<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`);\n }\n\n /**\n * Create a new service price\n */\n createServicePrice(price: ServicePriceCreateRequest): Observable<ServicePrice> {\n return this.post<ServicePrice>(`${this.apiUrl}/service-prices/`, price);\n }\n\n /**\n * Update an existing service price\n */\n updateServicePrice(id: number, price: ServicePriceUpdateRequest): Observable<ServicePrice> {\n return this.put<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`, price);\n }\n\n /**\n * Partially update a service price\n */\n patchServicePrice(id: number, price: Partial<ServicePriceUpdateRequest>): Observable<ServicePrice> {\n return this.patch<ServicePrice>(`${this.apiUrl}/service-prices/${id}/`, price);\n }\n\n /**\n * Delete a service price\n */\n deleteServicePrice(id: number): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/service-prices/${id}/`);\n }\n\n /**\n * Calculate total cost for a given quantity\n */\n calculateCost(id: number, request: ServicePriceCalculationRequest): Observable<CostBreakdown> {\n return this.post<CostBreakdown>(`${this.apiUrl}/service-prices/${id}/calculate_cost/`, request);\n }\n\n /**\n * Get current effective prices (Django custom action)\n */\n getCurrentPrices(): Observable<ServicePrice[]> {\n return this.get<ServicePrice[]>(`${this.apiUrl}/service-prices/current_prices/`);\n }\n\n /**\n * Search service prices by item or tier name\n */\n searchServicePrices(query: string): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ search: query });\n }\n\n /**\n * Get active service prices only\n */\n getActiveServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ isActive: true });\n }\n\n /**\n * Get inactive service prices\n */\n getInactiveServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ isActive: false });\n }\n\n /**\n * Get service prices by billing unit\n */\n getServicePricesByUnit(billingUnit: BillingUnit): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit });\n }\n\n /**\n * Get service prices by currency\n */\n getServicePricesByCurrency(currency: string): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ currency });\n }\n\n /**\n * Get service prices for a specific billable item type\n */\n getServicePricesForItemType(itemTypeId: number): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billableItemType: itemTypeId });\n }\n\n /**\n * Get service prices for a specific service tier\n */\n getServicePricesForTier(tierId: number): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ serviceTier: tierId });\n }\n\n /**\n * Get hourly service prices\n */\n getHourlyServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.HOURLY });\n }\n\n /**\n * Get usage-based service prices\n */\n getUsageServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.USAGE });\n }\n\n /**\n * Get flat rate service prices\n */\n getFlatRateServicePrices(): Observable<PaginatedResponse<ServicePrice>> {\n return this.getServicePrices({ billingUnit: BillingUnit.FLAT });\n }\n\n}","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { BaseApiService } from '@noatgnu/cupcake-core';\n\nimport {\n BillingApprovalResponse,\n BillingRecord,\n BillingRecordCreateRequest,\n BillingRecordUpdateRequest,\n BillingRecordSummary,\n BillingApprovalRequest,\n BillingStatus,\n CostCenterTotal,\n PaginatedResponse\n} from '../models';\n\nexport interface BillingRecordQueryParams {\n search?: string;\n status?: BillingStatus;\n currency?: string;\n costCenter?: string;\n userId?: number;\n serviceTier?: number;\n startDate?: string;\n endDate?: string;\n limit?: number;\n offset?: number;\n ordering?: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BillingRecordService extends BaseApiService {\n\n /**\n * Get all billing records with optional filtering\n */\n getBillingRecords(params?: BillingRecordQueryParams): Observable<PaginatedResponse<BillingRecord>> {\n const httpParams = this.buildHttpParams(params);\n return this.get<PaginatedResponse<BillingRecord>>(`${this.apiUrl}/billing-records/`, { params: httpParams });\n }\n\n /**\n * Get a single billing record by ID\n */\n getBillingRecord(id: string): Observable<BillingRecord> {\n return this.get<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`);\n }\n\n /**\n * Create a new billing record\n */\n createBillingRecord(record: BillingRecordCreateRequest): Observable<BillingRecord> {\n return this.post<BillingRecord>(`${this.apiUrl}/billing-records/`, record);\n }\n\n /**\n * Update an existing billing record\n */\n updateBillingRecord(id: string, record: BillingRecordUpdateRequest): Observable<BillingRecord> {\n return this.put<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`, record);\n }\n\n /**\n * Partially update a billing record\n */\n patchBillingRecord(id: string, record: Partial<BillingRecordUpdateRequest>): Observable<BillingRecord> {\n return this.patch<BillingRecord>(`${this.apiUrl}/billing-records/${id}/`, record);\n }\n\n /**\n * Delete a billing record\n */\n deleteBillingRecord(id: string): Observable<void> {\n return this.delete<void>(`${this.apiUrl}/billing-records/${id}/`);\n }\n\n /**\n * Approve a billing record\n */\n approveBillingRecord(id: string, request: BillingApprovalRequest): Observable<BillingApprovalResponse> {\n return this.post<BillingApprovalResponse>(`${this.apiUrl}/billing-records/${id}/approve/`, request);\n }\n\n\n /**\n * Get billing summary statistics (Django custom action)\n */\n getSummary(params?: {\n startDate?: string;\n endDate?: string;\n currency?: string;\n costCenter?: string;\n }): Observable<BillingRecordSummary> {\n const httpParams = this.buildHttpParams(params);\n return this.get<BillingRecordSummary>(`${this.apiUrl}/billing-records/summary/`, { params: httpParams });\n }\n\n /**\n * Get billing records pending approval (Django custom action)\n */\n getPendingApproval(): Observable<BillingRecord[]> {\n return this.get<BillingRecord[]>(`${this.apiUrl}/billing-records/pending_approval/`);\n }\n\n /**\n * Get billing records grouped by cost center (Django custom action)\n */\n getByCostCenter(): Observable<CostCenterTotal[]> {\n return this.get<CostCenterTotal[]>(`${this.apiUrl}/billing-records/by_cost_center/`);\n }\n\n /**\n * Get user billing records\n */\n getUserBillingRecords(userId: number): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ userId });\n }\n\n /**\n * Get my billing records (current user)\n */\n getMyBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.get<PaginatedResponse<BillingRecord>>(`${this.apiUrl}/billing-records/my_records/`);\n }\n\n /**\n * Search billing records by description, notes, or cost center\n */\n searchBillingRecords(query: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ search: query });\n }\n\n /**\n * Get pending billing records\n */\n getPendingBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.PENDING });\n }\n\n /**\n * Get approved billing records\n */\n getApprovedBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.APPROVED });\n }\n\n /**\n * Get billed billing records\n */\n getBilledBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.BILLED });\n }\n\n /**\n * Get paid billing records\n */\n getPaidBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.PAID });\n }\n\n /**\n * Get disputed billing records\n */\n getDisputedBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.DISPUTED });\n }\n\n /**\n * Get cancelled billing records\n */\n getCancelledBillingRecords(): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status: BillingStatus.CANCELLED });\n }\n\n /**\n * Get billing records by status\n */\n getBillingRecordsByStatus(status: BillingStatus): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ status });\n }\n\n /**\n * Get billing records by currency\n */\n getBillingRecordsByCurrency(currency: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ currency });\n }\n\n /**\n * Get billing records by cost center\n */\n getBillingRecordsByCostCenter(costCenter: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ costCenter });\n }\n\n /**\n * Get billing records by service tier\n */\n getBillingRecordsByServiceTier(tierId: number): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ serviceTier: tierId });\n }\n\n /**\n * Get billing records for date range\n */\n getBillingRecordsByDateRange(startDate: string, endDate: string): Observable<PaginatedResponse<BillingRecord>> {\n return this.getBillingRecords({ startDate, endDate });\n }\n\n}","// Billing and financial management services\nexport * from './service-tier';\nexport * from './billable-item-type';\nexport * from './service-price';\nexport * from './billing-record';","/*\n * Public API Surface of cupcake-salted-caramel\n */\n\nexport * from './lib/cupcake-salted-caramel';\n\nexport * from './lib/models';\nexport * from './lib/services';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAaa,oBAAoB,CAAA;uGAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EARrB;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA;;2FAIU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,SAAS;+BACE,6BAA6B,EAAA,OAAA,EAC9B,EAAE,EAAA,QAAA,EACD;;;;GAIT,EAAA,eAAA,EACgB,uBAAuB,CAAC,KAAK,EAAA;;;ICVpC;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,OAAA,CAAA,GAAA,OAAe;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,iBAAA;;;AChCD;;ACAA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noatgnu/cupcake-salted-caramel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "An extension for cupcake-core that provides additional api and interfaces for facility to manage billing.",
|
|
5
5
|
"author": "Toan Phung",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"url": "https://github.com/noatgnu/cupcake-vanilla-ng/issues"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@angular/common": "^
|
|
17
|
-
"@angular/core": "^
|
|
16
|
+
"@angular/common": "^22.0.0",
|
|
17
|
+
"@angular/core": "^22.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"tslib": "^2.3.0"
|
|
@@ -126,14 +126,29 @@ interface BillingRecord extends BaseTimestampedModel {
|
|
|
126
126
|
billingPeriodDays: number;
|
|
127
127
|
}
|
|
128
128
|
interface CostBreakdown {
|
|
129
|
+
servicePriceId: number;
|
|
130
|
+
billableItemType: string;
|
|
131
|
+
serviceTier: string;
|
|
132
|
+
billingUnit: string;
|
|
133
|
+
quantityRequested: number;
|
|
134
|
+
quantityBillable: number;
|
|
129
135
|
unitPrice: number;
|
|
130
136
|
subtotal: number;
|
|
131
137
|
setupFee: number;
|
|
132
138
|
bulkDiscount: number;
|
|
133
|
-
taxAmount
|
|
139
|
+
taxAmount?: number;
|
|
134
140
|
total: number;
|
|
135
141
|
currency: string;
|
|
136
142
|
}
|
|
143
|
+
interface BillingApprovalResponse {
|
|
144
|
+
message: string;
|
|
145
|
+
billingRecord: BillingRecord;
|
|
146
|
+
}
|
|
147
|
+
interface CostCenterTotal {
|
|
148
|
+
costCenter: string;
|
|
149
|
+
recordCount: number;
|
|
150
|
+
totalAmount: number;
|
|
151
|
+
}
|
|
137
152
|
interface ServiceTierCreateRequest {
|
|
138
153
|
tierName: string;
|
|
139
154
|
description?: string;
|
|
@@ -481,10 +496,10 @@ interface BillingRecordQueryParams {
|
|
|
481
496
|
status?: BillingStatus;
|
|
482
497
|
currency?: string;
|
|
483
498
|
costCenter?: string;
|
|
484
|
-
|
|
499
|
+
userId?: number;
|
|
485
500
|
serviceTier?: number;
|
|
486
|
-
|
|
487
|
-
|
|
501
|
+
startDate?: string;
|
|
502
|
+
endDate?: string;
|
|
488
503
|
limit?: number;
|
|
489
504
|
offset?: number;
|
|
490
505
|
ordering?: string;
|
|
@@ -517,27 +532,24 @@ declare class BillingRecordService extends BaseApiService {
|
|
|
517
532
|
/**
|
|
518
533
|
* Approve a billing record
|
|
519
534
|
*/
|
|
520
|
-
approveBillingRecord(id: string, request: BillingApprovalRequest): Observable<
|
|
535
|
+
approveBillingRecord(id: string, request: BillingApprovalRequest): Observable<BillingApprovalResponse>;
|
|
521
536
|
/**
|
|
522
537
|
* Get billing summary statistics (Django custom action)
|
|
523
538
|
*/
|
|
524
539
|
getSummary(params?: {
|
|
525
|
-
|
|
526
|
-
|
|
540
|
+
startDate?: string;
|
|
541
|
+
endDate?: string;
|
|
527
542
|
currency?: string;
|
|
528
543
|
costCenter?: string;
|
|
529
|
-
serviceTier?: number;
|
|
530
544
|
}): Observable<BillingRecordSummary>;
|
|
531
545
|
/**
|
|
532
546
|
* Get billing records pending approval (Django custom action)
|
|
533
547
|
*/
|
|
534
|
-
getPendingApproval(): Observable<
|
|
548
|
+
getPendingApproval(): Observable<BillingRecord[]>;
|
|
535
549
|
/**
|
|
536
550
|
* Get billing records grouped by cost center (Django custom action)
|
|
537
551
|
*/
|
|
538
|
-
getByCostCenter(): Observable<
|
|
539
|
-
[key: string]: BillingRecord[];
|
|
540
|
-
}>;
|
|
552
|
+
getByCostCenter(): Observable<CostCenterTotal[]>;
|
|
541
553
|
/**
|
|
542
554
|
* Get user billing records
|
|
543
555
|
*/
|
|
@@ -593,10 +605,10 @@ declare class BillingRecordService extends BaseApiService {
|
|
|
593
605
|
/**
|
|
594
606
|
* Get billing records for date range
|
|
595
607
|
*/
|
|
596
|
-
getBillingRecordsByDateRange(
|
|
608
|
+
getBillingRecordsByDateRange(startDate: string, endDate: string): Observable<PaginatedResponse<BillingRecord>>;
|
|
597
609
|
static ɵfac: i0.ɵɵFactoryDeclaration<BillingRecordService, never>;
|
|
598
610
|
static ɵprov: i0.ɵɵInjectableDeclaration<BillingRecordService>;
|
|
599
611
|
}
|
|
600
612
|
|
|
601
613
|
export { BillableItemTypeService, BillingRecordService, BillingStatus, BillingUnit, CupcakeSaltedCaramel, ServicePriceService, ServiceTierService };
|
|
602
|
-
export type { BaseTimestampedModel, BillableItemType, BillableItemTypeCreateRequest, BillableItemTypeQueryParams, BillableItemTypeUpdateRequest, BillingApprovalRequest, BillingRecord, BillingRecordCreateRequest, BillingRecordQueryParams, BillingRecordSummary, BillingRecordUpdateRequest, CostBreakdown, PaginatedResponse, ServicePrice, ServicePriceCalculationRequest, ServicePriceCreateRequest, ServicePriceQueryParams, ServicePriceUpdateRequest, ServiceTier, ServiceTierCreateRequest, ServiceTierQueryParams, ServiceTierUpdateRequest, UserBasic };
|
|
614
|
+
export type { BaseTimestampedModel, BillableItemType, BillableItemTypeCreateRequest, BillableItemTypeQueryParams, BillableItemTypeUpdateRequest, BillingApprovalRequest, BillingApprovalResponse, BillingRecord, BillingRecordCreateRequest, BillingRecordQueryParams, BillingRecordSummary, BillingRecordUpdateRequest, CostBreakdown, CostCenterTotal, PaginatedResponse, ServicePrice, ServicePriceCalculationRequest, ServicePriceCreateRequest, ServicePriceQueryParams, ServicePriceUpdateRequest, ServiceTier, ServiceTierCreateRequest, ServiceTierQueryParams, ServiceTierUpdateRequest, UserBasic };
|