@fiado/type-kit 3.518.0 → 3.520.0
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.
- package/_test_/unit/retailWizard/fixtures/saleWithoutPhone.strict.ts +57 -0
- package/_test_/unit/retailWizard/saleWithoutPhone.test.ts +46 -0
- package/_test_/unit/retailWizard/saleWithoutPhoneLines.test.ts +82 -0
- package/_test_/unit/rewards/backoffice.test.ts +1 -1
- package/_test_/unit/rewards/chargeDtos.test.ts +21 -0
- package/_test_/unit/rewards/deliveryMetricsDtos.test.ts +25 -0
- package/_test_/unit/rewards/grantBackofficeDtos.test.ts +30 -0
- package/_test_/unit/rewards/partnerDtos.test.ts +47 -0
- package/bin/retailCommission/dtos/CommissionAccrual.d.ts +2 -1
- package/bin/retailWizard/dtos/Sale.d.ts +3 -2
- package/bin/retailWizard/dtos/WizardLineProduct.d.ts +3 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +2 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +6 -0
- package/bin/retailWizard/events/SaleCompletedV1.d.ts +3 -2
- package/bin/retailWizard/events/SaleCompletedV2.d.ts +2 -1
- package/bin/rewards/constants/BackofficeLimits.d.ts +13 -0
- package/bin/rewards/constants/BackofficeLimits.js +14 -1
- package/bin/rewards/dtos/backoffice/BackofficeGrantAttemptResponse.d.ts +5 -0
- package/bin/rewards/dtos/backoffice/BackofficeGrantAttemptResponse.js +7 -0
- package/bin/rewards/dtos/backoffice/BackofficeGrantItemResponse.d.ts +7 -0
- package/bin/rewards/dtos/backoffice/BackofficeGrantItemResponse.js +7 -0
- package/bin/rewards/dtos/backoffice/BackofficeGrantResponse.d.ts +7 -0
- package/bin/rewards/dtos/backoffice/BackofficeGrantResponse.js +8 -0
- package/bin/rewards/dtos/backoffice/ChargeListResponse.d.ts +6 -0
- package/bin/rewards/dtos/backoffice/ChargeListResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/ChargeRecord.d.ts +17 -0
- package/bin/rewards/dtos/backoffice/ChargeRecord.js +7 -0
- package/bin/rewards/dtos/backoffice/ChargesExportQuery.d.ts +5 -0
- package/bin/rewards/dtos/backoffice/ChargesExportQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/ChargesQuery.d.ts +7 -0
- package/bin/rewards/dtos/backoffice/ChargesQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/DeliveryMetricsPoint.d.ts +13 -0
- package/bin/rewards/dtos/backoffice/DeliveryMetricsPoint.js +7 -0
- package/bin/rewards/dtos/backoffice/DeliveryMetricsQuery.d.ts +9 -0
- package/bin/rewards/dtos/backoffice/DeliveryMetricsQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/DeliveryTopEntry.d.ts +16 -0
- package/bin/rewards/dtos/backoffice/DeliveryTopEntry.js +7 -0
- package/bin/rewards/dtos/backoffice/DeliveryTopQuery.d.ts +11 -0
- package/bin/rewards/dtos/backoffice/DeliveryTopQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/GrantListQuery.d.ts +22 -0
- package/bin/rewards/dtos/backoffice/GrantListQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/GrantListResponse.d.ts +5 -0
- package/bin/rewards/dtos/backoffice/GrantListResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/PartnerListResponse.d.ts +6 -0
- package/bin/rewards/dtos/backoffice/PartnerListResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/PartnerRequest.d.ts +7 -0
- package/bin/rewards/dtos/backoffice/PartnerRequest.js +38 -0
- package/bin/rewards/dtos/backoffice/PartnerResponse.d.ts +11 -0
- package/bin/rewards/dtos/backoffice/PartnerResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/PartnerSummary.d.ts +12 -0
- package/bin/rewards/dtos/backoffice/PartnerSummary.js +7 -0
- package/bin/rewards/dtos/backoffice/PartnersSummaryQuery.d.ts +5 -0
- package/bin/rewards/dtos/backoffice/PartnersSummaryQuery.js +7 -0
- package/bin/rewards/dtos/backoffice/RewardChargeToInput.d.ts +1 -1
- package/bin/rewards/dtos/backoffice/RewardChargeToInput.js +1 -7
- package/bin/rewards/enums/DeliveryDimensionEnum.d.ts +8 -0
- package/bin/rewards/enums/DeliveryDimensionEnum.js +12 -0
- package/bin/rewards/enums/DeliveryTopByEnum.d.ts +5 -0
- package/bin/rewards/enums/DeliveryTopByEnum.js +9 -0
- package/bin/rewards/enums/DeliveryTopDimensionEnum.d.ts +7 -0
- package/bin/rewards/enums/DeliveryTopDimensionEnum.js +11 -0
- package/bin/rewards/index.d.ts +21 -0
- package/bin/rewards/index.js +21 -0
- package/package.json +1 -1
- package/src/retailCommission/dtos/CommissionAccrual.ts +2 -1
- package/src/retailWizard/dtos/Sale.ts +3 -2
- package/src/retailWizard/dtos/WizardLineProduct.ts +3 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +6 -0
- package/src/retailWizard/events/SaleCompletedV1.ts +3 -2
- package/src/retailWizard/events/SaleCompletedV2.ts +2 -1
- package/src/rewards/constants/BackofficeLimits.ts +16 -0
- package/src/rewards/dtos/backoffice/BackofficeGrantAttemptResponse.ts +6 -0
- package/src/rewards/dtos/backoffice/BackofficeGrantItemResponse.ts +8 -0
- package/src/rewards/dtos/backoffice/BackofficeGrantResponse.ts +8 -0
- package/src/rewards/dtos/backoffice/ChargeListResponse.ts +7 -0
- package/src/rewards/dtos/backoffice/ChargeRecord.ts +18 -0
- package/src/rewards/dtos/backoffice/ChargesExportQuery.ts +5 -0
- package/src/rewards/dtos/backoffice/ChargesQuery.ts +7 -0
- package/src/rewards/dtos/backoffice/DeliveryMetricsPoint.ts +14 -0
- package/src/rewards/dtos/backoffice/DeliveryMetricsQuery.ts +10 -0
- package/src/rewards/dtos/backoffice/DeliveryTopEntry.ts +14 -0
- package/src/rewards/dtos/backoffice/DeliveryTopQuery.ts +12 -0
- package/src/rewards/dtos/backoffice/GrantListQuery.ts +23 -0
- package/src/rewards/dtos/backoffice/GrantListResponse.ts +6 -0
- package/src/rewards/dtos/backoffice/PartnerListResponse.ts +7 -0
- package/src/rewards/dtos/backoffice/PartnerRequest.ts +22 -0
- package/src/rewards/dtos/backoffice/PartnerResponse.ts +12 -0
- package/src/rewards/dtos/backoffice/PartnerSummary.ts +13 -0
- package/src/rewards/dtos/backoffice/PartnersSummaryQuery.ts +5 -0
- package/src/rewards/dtos/backoffice/RewardChargeToInput.ts +1 -6
- package/src/rewards/enums/DeliveryDimensionEnum.ts +8 -0
- package/src/rewards/enums/DeliveryTopByEnum.ts +5 -0
- package/src/rewards/enums/DeliveryTopDimensionEnum.ts +7 -0
- package/src/rewards/index.ts +21 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SaleTypeEnum } from '../../../../src/retailWizard/enums/SaleTypeEnum';
|
|
2
|
+
import { SaleFinancierEnum } from '../../../../src/retailWizard/enums/SaleFinancierEnum';
|
|
3
|
+
import type { Sale } from '../../../../src/retailWizard/dtos/Sale';
|
|
4
|
+
import type { SaleCompletedV1 } from '../../../../src/retailWizard/events/SaleCompletedV1';
|
|
5
|
+
import type { SaleCompletedV2 } from '../../../../src/retailWizard/events/SaleCompletedV2';
|
|
6
|
+
import type { CommissionSaleInput } from '../../../../src/retailCommission/dtos/CommissionAccrual';
|
|
7
|
+
|
|
8
|
+
// Venta de contado sin teléfono; el test lo compila con strict, como los consumidores.
|
|
9
|
+
export const saleSku: Sale['sku'] = null;
|
|
10
|
+
|
|
11
|
+
export const completedV1: SaleCompletedV1 = {
|
|
12
|
+
saleId: 's-1',
|
|
13
|
+
folio: 'LG-T001-VTA-abcde-2026W40',
|
|
14
|
+
retailerId: 'r-1',
|
|
15
|
+
storeId: 'st-1',
|
|
16
|
+
retailCustomerId: 'c-1',
|
|
17
|
+
sku: null,
|
|
18
|
+
imei: null,
|
|
19
|
+
amountCents: 35000,
|
|
20
|
+
type: SaleTypeEnum.CASH,
|
|
21
|
+
soldAt: '2026-10-08T12:00:00.000Z',
|
|
22
|
+
occurredAt: '2026-10-08T12:00:00.000Z',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const completedV2: SaleCompletedV2 = {
|
|
26
|
+
saleId: 's-1',
|
|
27
|
+
folio: 'LG-T001-VTA-abcde-2026W40',
|
|
28
|
+
retailerId: 'r-1',
|
|
29
|
+
storeId: 'st-1',
|
|
30
|
+
sellerRetailUserId: 'u-1',
|
|
31
|
+
retailCustomerId: 'c-1',
|
|
32
|
+
sku: null,
|
|
33
|
+
brand: null,
|
|
34
|
+
imei: null,
|
|
35
|
+
amountCents: 35000,
|
|
36
|
+
equipmentPriceCents: null,
|
|
37
|
+
downPaymentCents: null,
|
|
38
|
+
creditId: null,
|
|
39
|
+
type: SaleTypeEnum.CASH,
|
|
40
|
+
externalProvider: null,
|
|
41
|
+
soldAt: '2026-10-08T12:00:00.000Z',
|
|
42
|
+
occurredAt: '2026-10-08T12:00:00.000Z',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const commissionInput: CommissionSaleInput = {
|
|
46
|
+
saleId: 's-1',
|
|
47
|
+
sellerId: 'u-1',
|
|
48
|
+
retailerId: 'r-1',
|
|
49
|
+
storeId: 'st-1',
|
|
50
|
+
sku: null,
|
|
51
|
+
brand: null,
|
|
52
|
+
equipmentPriceCents: null,
|
|
53
|
+
amountCents: 35000,
|
|
54
|
+
financier: Object.values(SaleFinancierEnum)[0],
|
|
55
|
+
paymentType: 'CASH',
|
|
56
|
+
soldAt: '2026-10-08T12:00:00.000Z',
|
|
57
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
import {
|
|
5
|
+
commissionInput,
|
|
6
|
+
completedV1,
|
|
7
|
+
completedV2,
|
|
8
|
+
saleSku,
|
|
9
|
+
} from './fixtures/saleWithoutPhone.strict';
|
|
10
|
+
|
|
11
|
+
const FIXTURE = path.join(__dirname, 'fixtures', 'saleWithoutPhone.strict.ts');
|
|
12
|
+
|
|
13
|
+
// Los consumidores compilan con strict; sin strictNullChecks null cabe en string y no prueba nada.
|
|
14
|
+
function strictDiagnostics(): string[] {
|
|
15
|
+
const program = ts.createProgram([FIXTURE], {
|
|
16
|
+
strict: true,
|
|
17
|
+
noEmit: true,
|
|
18
|
+
skipLibCheck: true,
|
|
19
|
+
experimentalDecorators: true,
|
|
20
|
+
emitDecoratorMetadata: true,
|
|
21
|
+
target: ts.ScriptTarget.ES2020,
|
|
22
|
+
module: ts.ModuleKind.CommonJS,
|
|
23
|
+
moduleResolution: ts.ModuleResolutionKind.Node10,
|
|
24
|
+
});
|
|
25
|
+
return ts
|
|
26
|
+
.getPreEmitDiagnostics(program)
|
|
27
|
+
.filter((d) => d.file?.fileName === FIXTURE)
|
|
28
|
+
.map((d) => ts.flattenDiagnosticMessageText(d.messageText, '\n'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('venta sin teléfono — sku nullable', () => {
|
|
32
|
+
it('Sale, SaleCompletedV1/V2 y CommissionSaleInput aceptan sku null en strict', () => {
|
|
33
|
+
expect(strictDiagnostics()).toEqual([]);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('el payload viaja con sku null', () => {
|
|
37
|
+
expect(saleSku).toBeNull();
|
|
38
|
+
expect(completedV2.sku).toBeNull();
|
|
39
|
+
expect(commissionInput.sku).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('SaleCompletedV1 omite equipmentPriceCents sin equipo', () => {
|
|
43
|
+
expect(completedV1.sku).toBeNull();
|
|
44
|
+
expect(completedV1).not.toHaveProperty('equipmentPriceCents');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync, type ValidationError } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
LinePaymentTypeEnum,
|
|
6
|
+
RetailCommissionInboundMessage,
|
|
7
|
+
RetailCommissionInboundMessageTypeEnum,
|
|
8
|
+
SaleTypeEnum,
|
|
9
|
+
type WizardLineProduct,
|
|
10
|
+
} from '../../../src/retailWizard';
|
|
11
|
+
import { ItemTypeEnum, ProductCategoryEnum, TrackingModeEnum } from '../../../src/retailCatalog';
|
|
12
|
+
|
|
13
|
+
function paths(errors: ValidationError[], prefix = ''): string[] {
|
|
14
|
+
return errors.flatMap((e) => {
|
|
15
|
+
const p = prefix ? `${prefix}.${e.property}` : e.property;
|
|
16
|
+
return e.children && e.children.length > 0 ? paths(e.children, p) : [p];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function errorsOf(payload: object): string[] {
|
|
21
|
+
return paths(validateSync(plainToInstance(RetailCommissionInboundMessage, payload) as object));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('venta sin teléfono — phoneCount en el mensaje a comisiones', () => {
|
|
25
|
+
const kit = {
|
|
26
|
+
lineId: 'L1',
|
|
27
|
+
sku: 'KIT-1',
|
|
28
|
+
qty: 1,
|
|
29
|
+
netCents: 349900,
|
|
30
|
+
itemType: ItemTypeEnum.PRODUCT,
|
|
31
|
+
category: ProductCategoryEnum.ACCESSORY,
|
|
32
|
+
tier: null,
|
|
33
|
+
brand: null,
|
|
34
|
+
paymentType: LinePaymentTypeEnum.CASH,
|
|
35
|
+
};
|
|
36
|
+
const message = (line: object) => ({
|
|
37
|
+
type: RetailCommissionInboundMessageTypeEnum.SALE_COMPLETED,
|
|
38
|
+
tenantId: 't',
|
|
39
|
+
retailerId: 'ret',
|
|
40
|
+
storeId: 'st',
|
|
41
|
+
saleId: 'sale-1',
|
|
42
|
+
sessionId: 'ses-1',
|
|
43
|
+
sellerRetailUserId: 'seller-1',
|
|
44
|
+
saleType: SaleTypeEnum.CASH,
|
|
45
|
+
externalProvider: null,
|
|
46
|
+
creditId: null,
|
|
47
|
+
soldAt: '2026-10-08T20:00:00.000Z',
|
|
48
|
+
occurredAt: '2026-10-08T20:00:00.000Z',
|
|
49
|
+
lines: [line],
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('un mensaje viejo sin phoneCount sigue validando', () => expect(errorsOf(message(kit))).toEqual([]));
|
|
53
|
+
|
|
54
|
+
it('acepta phoneCount en 0 y positivo', () => {
|
|
55
|
+
expect(errorsOf(message({ ...kit, phoneCount: 0 }))).toEqual([]);
|
|
56
|
+
expect(errorsOf(message({ ...kit, phoneCount: 2 }))).toEqual([]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('rechaza phoneCount negativo o no entero', () => {
|
|
60
|
+
expect(errorsOf(message({ ...kit, phoneCount: -1 }))).toEqual(['lines.0.phoneCount']);
|
|
61
|
+
expect(errorsOf(message({ ...kit, phoneCount: 1.5 }))).toEqual(['lines.0.phoneCount']);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe('venta sin teléfono — itemType en la ficha de la línea de sesión', () => {
|
|
66
|
+
const base: WizardLineProduct = {
|
|
67
|
+
brand: 'Genérico',
|
|
68
|
+
model: 'Funda',
|
|
69
|
+
capacity: null,
|
|
70
|
+
color: null,
|
|
71
|
+
imageUrl: null,
|
|
72
|
+
tier: null,
|
|
73
|
+
category: ProductCategoryEnum.ACCESSORY,
|
|
74
|
+
trackingMode: TrackingModeEnum.QUANTITY,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
it('acepta itemType y también su ausencia', () => {
|
|
78
|
+
const service: WizardLineProduct = { ...base, itemType: ItemTypeEnum.SERVICE };
|
|
79
|
+
expect(service.itemType).toBe(ItemTypeEnum.SERVICE);
|
|
80
|
+
expect(base.itemType).toBeUndefined();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -11,7 +11,7 @@ const catalog = {
|
|
|
11
11
|
type: 'ExampleType',
|
|
12
12
|
config: { amount: 50, nested: { list: [1, 2] } },
|
|
13
13
|
cost: { amount: 50, currency: 'MXN' },
|
|
14
|
-
chargeTo: { partnerId: 'ALIADO-001'
|
|
14
|
+
chargeTo: { partnerId: 'ALIADO-001' },
|
|
15
15
|
status: 'ACTIVE',
|
|
16
16
|
};
|
|
17
17
|
const pkg = { id: 'paquete-1', name: 'Paquete 1', status: 'ACTIVE', items: [{ itemKey: 'itemA', catalogItemId: 'example-reward-a' }] };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { CurrencyId } from '../../../src/currency';
|
|
3
|
+
import { CHARGES_EXPORT_MAX_ROWS, CHARGES_MONTH_PATTERN } from '../../../src/rewards';
|
|
4
|
+
import type { ChargeListResponse, ChargeRecord, ChargesExportQuery, ChargesQuery } from '../../../src/rewards';
|
|
5
|
+
|
|
6
|
+
describe('contrato de cargos (D-C1)', () => {
|
|
7
|
+
it.each(['2026-01', '2026-12'])('acepta el mes %s', (m) => expect(CHARGES_MONTH_PATTERN.test(m)).toBe(true));
|
|
8
|
+
it.each(['2026-13', '2026-00', '26-10', '2026-1', '2026-10-01'])('rechaza el mes %s', (m) => expect(CHARGES_MONTH_PATTERN.test(m)).toBe(false));
|
|
9
|
+
|
|
10
|
+
it('tope del export y forma de ChargeRecord (con packageId, sin source)', () => {
|
|
11
|
+
const record: ChargeRecord = {
|
|
12
|
+
grantId: 'g', itemKey: 'a', grantedAt: 1, directoryId: 'd', catalogItemId: 'c', catalogItemName: 'Recarga', packageId: 'p',
|
|
13
|
+
cost: { amount: 10, currency: CurrencyId.MXN }, chargeTo: { partnerId: 'FIADO', partnerName: 'Fiado' },
|
|
14
|
+
};
|
|
15
|
+
const list: ChargeListResponse = { items: [record] };
|
|
16
|
+
const q: ChargesQuery = { partnerId: 'FIADO', month: '2026-10', limit: 10 };
|
|
17
|
+
const e: ChargesExportQuery = { partnerId: 'FIADO', month: '2026-10' };
|
|
18
|
+
expect([CHARGES_EXPORT_MAX_ROWS, list.items.length, q.month, e.partnerId]).toEqual([10000, 1, '2026-10', 'FIADO']);
|
|
19
|
+
expect('source' in record).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import {
|
|
3
|
+
DeliveryDimensionEnum, DeliveryTopByEnum, DeliveryTopDimensionEnum, METRICS_TAG_ALLOWLIST, METRICS_TAG_DIMENSION_PATTERN,
|
|
4
|
+
METRICS_TOP_LIMIT, METRICS_TOP_MAX_VALUES,
|
|
5
|
+
} from '../../../src/rewards';
|
|
6
|
+
import type { DeliveryMetricsPoint, DeliveryTopEntry } from '../../../src/rewards';
|
|
7
|
+
import { CurrencyId } from '../../../src/currency';
|
|
8
|
+
|
|
9
|
+
describe('contrato de métricas de entregas (D-D3)', () => {
|
|
10
|
+
it('constantes y enums del spec §4.3/§5.5', () => {
|
|
11
|
+
expect([METRICS_TOP_LIMIT, METRICS_TOP_MAX_VALUES]).toEqual([10, 200]);
|
|
12
|
+
expect(METRICS_TAG_ALLOWLIST).toEqual(['campaignId', 'evaluationId']);
|
|
13
|
+
expect(Object.values(DeliveryDimensionEnum)).toEqual(['ALL', 'PACKAGE', 'CATALOG_ITEM', 'PARTNER', 'SOURCE']);
|
|
14
|
+
expect(Object.values(DeliveryTopDimensionEnum)).toEqual(['PACKAGE', 'CATALOG_ITEM', 'PARTNER', 'SOURCE']);
|
|
15
|
+
expect(Object.values(DeliveryTopByEnum)).toEqual(['cost', 'count']);
|
|
16
|
+
});
|
|
17
|
+
it.each(['TAG#campaignId', 'TAG#evaluationId'])('acepta %s', (d) => expect(METRICS_TAG_DIMENSION_PATTERN.test(d)).toBe(true));
|
|
18
|
+
it.each(['TAG#userId', 'TAG#', 'tag#campaignId', 'TAG#campaignId#x'])('rechaza %s', (d) => expect(METRICS_TAG_DIMENSION_PATTERN.test(d)).toBe(false));
|
|
19
|
+
|
|
20
|
+
it('formas de punto y top', () => {
|
|
21
|
+
const p: DeliveryMetricsPoint = { date: '2026-10-08', currency: CurrencyId.MXN, granted: 1, failed: 0, skipped: 0, grantsCompleted: 1, grantsPartial: 0, grantsFailed: 0, costGranted: 10.5 };
|
|
22
|
+
const t: DeliveryTopEntry = { value: 'FIADO', label: 'Fiado', granted: 1, failed: 0, skipped: 0, cost: [{ amount: 10.5, currency: CurrencyId.MXN }] };
|
|
23
|
+
expect([p.costGranted, t.cost[0].amount]).toEqual([10.5, 10.5]);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { GRANTS_DEFAULT_RANGE_DAYS, GRANTS_EXPORT_MAX_ROWS, GRANTS_MAX_RANGE_DAYS } from '../../../src/rewards';
|
|
3
|
+
import { CurrencyId } from '../../../src/currency';
|
|
4
|
+
import type { BackofficeGrantResponse, GrantListQuery, GrantListResponse } from '../../../src/rewards';
|
|
5
|
+
import { GrantItemStatusEnum, GrantStatusEnum, ItemErrorCategoryEnum, RewardStatusEnum } from '../../../src/rewards';
|
|
6
|
+
|
|
7
|
+
describe('contrato de entregas de backoffice (Fase 4)', () => {
|
|
8
|
+
it('expone los límites del spec §6', () => {
|
|
9
|
+
expect([GRANTS_MAX_RANGE_DAYS, GRANTS_DEFAULT_RANGE_DAYS, GRANTS_EXPORT_MAX_ROWS]).toEqual([92, 7, 5000]);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('BackofficeGrantResponse extiende GrantResponse con name por ítem y message por intento', () => {
|
|
13
|
+
const grant: BackofficeGrantResponse = {
|
|
14
|
+
id: 'g1', directoryId: 'd1', packageId: 'p1', packageVersion: 1, packageName: 'Paquete',
|
|
15
|
+
source: { service: 'rewards-eligibility', reference: 'run-1' }, status: GrantStatusEnum.PARTIAL, createdAt: 1, updatedAt: 2,
|
|
16
|
+
items: [{
|
|
17
|
+
itemKey: 'a', catalogItemId: 'c', name: 'Recarga', status: GrantItemStatusEnum.FAILED,
|
|
18
|
+
chargeTo: { partnerId: 'FIADO', partnerName: 'Fiado' }, cost: { amount: 10, currency: CurrencyId.MXN }, attemptCount: 1,
|
|
19
|
+
attempts: [{ attempt: 1, startedAt: 1, finishedAt: 2, errorCategory: ItemErrorCategoryEnum.PROVIDER_REJECTED, message: 'El proveedor rechazó la operación' }],
|
|
20
|
+
}],
|
|
21
|
+
};
|
|
22
|
+
expect(grant.items[0].attempts[0].message).toContain('proveedor');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('GrantListQuery admite los filtros nuevos D-F1', () => {
|
|
26
|
+
const q: GrantListQuery = { status: 'PARTIAL,FAILED', catalogItemId: 'reward-a', errorCategory: ItemErrorCategoryEnum.INTERNAL_ERROR, search: 'abc', limit: 20 };
|
|
27
|
+
const res: GrantListResponse = { items: [] };
|
|
28
|
+
expect([q.catalogItemId, res.items.length, RewardStatusEnum.ACTIVE]).toEqual(['reward-a', 0, 'ACTIVE']);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import type { JsonValue } from '../../../src/common';
|
|
5
|
+
import { CatalogItemRequest, PartnerRequest, RewardChargeToInput } from '../../../src/rewards';
|
|
6
|
+
|
|
7
|
+
const partner = { id: 'telcel-mx', name: 'Telcel México', status: 'ACTIVE' };
|
|
8
|
+
const asPartner = (o: Record<string, JsonValue> = {}): PartnerRequest =>
|
|
9
|
+
plainToInstance(PartnerRequest, { ...partner, ...o }, { excludeExtraneousValues: true });
|
|
10
|
+
const props = async (dto: object): Promise<string[]> => (await validate(dto)).map((e) => e.property);
|
|
11
|
+
|
|
12
|
+
describe('PartnerRequest', () => {
|
|
13
|
+
it('valida un aliado correcto', async () => {
|
|
14
|
+
expect(await validate(asPartner())).toHaveLength(0);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it.each<[string, Record<string, JsonValue>, string]>([
|
|
18
|
+
['id con espacios', { id: 'con espacio' }, 'id'],
|
|
19
|
+
['id con #', { id: 'a#b' }, 'id'],
|
|
20
|
+
['id vacío', { id: '' }, 'id'],
|
|
21
|
+
['id de 65 caracteres', { id: 'x'.repeat(65) }, 'id'],
|
|
22
|
+
['name vacío', { name: '' }, 'name'],
|
|
23
|
+
['name > 120', { name: 'x'.repeat(121) }, 'name'],
|
|
24
|
+
['status desconocido', { status: 'BORRADO' }, 'status'],
|
|
25
|
+
])('rechaza %s', async (_label, override, property) => {
|
|
26
|
+
expect(await props(asPartner(override))).toContain(property);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe('RewardChargeToInput (D-A2: el operador ya no escribe partnerName)', () => {
|
|
31
|
+
it('solo expone partnerId y descarta partnerName del cliente', () => {
|
|
32
|
+
const dto = plainToInstance(RewardChargeToInput, { partnerId: 'telcel-mx', partnerName: 'Falso' }, { excludeExtraneousValues: true });
|
|
33
|
+
expect(dto).toEqual({ partnerId: 'telcel-mx' });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('CatalogItemRequest valida sin partnerName', async () => {
|
|
37
|
+
const dto = plainToInstance(
|
|
38
|
+
CatalogItemRequest,
|
|
39
|
+
{
|
|
40
|
+
id: 'r-a', name: 'A', description: 'd', type: 'T', config: {}, cost: { amount: 1, currency: 'MXN' },
|
|
41
|
+
chargeTo: { partnerId: 'FIADO' }, status: 'ACTIVE',
|
|
42
|
+
},
|
|
43
|
+
{ excludeExtraneousValues: true },
|
|
44
|
+
);
|
|
45
|
+
expect(await validate(dto)).toHaveLength(0);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -69,7 +69,8 @@ export interface CommissionSaleInput {
|
|
|
69
69
|
sellerId: string;
|
|
70
70
|
retailerId: string;
|
|
71
71
|
storeId: string;
|
|
72
|
-
|
|
72
|
+
/** `null` en la venta sin teléfono: se comisiona solo por accesorios. */
|
|
73
|
+
sku: string | null;
|
|
73
74
|
brand: string | null;
|
|
74
75
|
/**
|
|
75
76
|
* 🔴 **La base de comisión es el PRECIO DEL EQUIPO, no lo cobrado en caja.**
|
|
@@ -20,8 +20,9 @@ export interface Sale {
|
|
|
20
20
|
wizardSessionId: string;
|
|
21
21
|
type: SaleTypeEnum;
|
|
22
22
|
externalProvider: ExternalProviderEnum | null;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/** SKU del teléfono de la venta; `null` en la venta sin teléfono (en DDB se omite). */
|
|
24
|
+
sku: string | null;
|
|
25
|
+
/** Líneas vendidas; `sku` e `imei` son los del teléfono, o `null` si la venta no lleva teléfono. */
|
|
25
26
|
lines?: SaleLine[];
|
|
26
27
|
/** SKUs de líneas y componentes, para filtrar ventas por SKU. */
|
|
27
28
|
skus?: string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ItemTypeEnum } from '../../retailCatalog/enums/ItemTypeEnum';
|
|
1
2
|
import type { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
3
|
import type { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
3
4
|
import type { TrackingModeEnum } from '../../retailCatalog/enums/TrackingModeEnum';
|
|
@@ -12,4 +13,6 @@ export interface WizardLineProduct {
|
|
|
12
13
|
tier: ProductTierEnum | null;
|
|
13
14
|
category: ProductCategoryEnum;
|
|
14
15
|
trackingMode: TrackingModeEnum;
|
|
16
|
+
/** Producto físico o servicio; ausente en líneas viejas (el consumidor lo toma como PRODUCT). */
|
|
17
|
+
itemType?: ItemTypeEnum;
|
|
15
18
|
}
|
|
@@ -21,6 +21,8 @@ export declare class RetailCommissionInboundLine {
|
|
|
21
21
|
brand: string | null;
|
|
22
22
|
paymentType: LinePaymentTypeEnum;
|
|
23
23
|
role?: WizardLineRoleEnum;
|
|
24
|
+
/** Teléfonos que trae la línea (kit), congelados al cerrar; ausente en mensajes viejos. */
|
|
25
|
+
phoneCount?: number;
|
|
24
26
|
}
|
|
25
27
|
/** Venta cerrada o cancelada que el wizard publica en RetailCommissionInboundQueue. */
|
|
26
28
|
export declare class RetailCommissionInboundMessage {
|
|
@@ -72,6 +72,12 @@ __decorate([
|
|
|
72
72
|
(0, class_validator_1.IsEnum)(WizardLineRoleEnum_1.WizardLineRoleEnum),
|
|
73
73
|
__metadata("design:type", String)
|
|
74
74
|
], RetailCommissionInboundLine.prototype, "role", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsOptional)(),
|
|
77
|
+
(0, class_validator_1.IsInt)(),
|
|
78
|
+
(0, class_validator_1.Min)(0),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], RetailCommissionInboundLine.prototype, "phoneCount", void 0);
|
|
75
81
|
/** Venta cerrada o cancelada que el wizard publica en RetailCommissionInboundQueue. */
|
|
76
82
|
class RetailCommissionInboundMessage {
|
|
77
83
|
}
|
|
@@ -10,7 +10,8 @@ export interface SaleCompletedV1 {
|
|
|
10
10
|
retailerId: string;
|
|
11
11
|
storeId: string;
|
|
12
12
|
retailCustomerId: string;
|
|
13
|
-
|
|
13
|
+
/** `null` en la venta sin teléfono. */
|
|
14
|
+
sku: string | null;
|
|
14
15
|
imei: string | null;
|
|
15
16
|
/**
|
|
16
17
|
* Lo cobrado en caja al cerrar: enganche + lo no financiado (en contado, el total).
|
|
@@ -22,7 +23,7 @@ export interface SaleCompletedV1 {
|
|
|
22
23
|
* sin `type` un crédito con $1,300 de enganche era indistinguible de un contado de $1,300.
|
|
23
24
|
*/
|
|
24
25
|
type?: SaleTypeEnum;
|
|
25
|
-
/** Precio de lista del equipo; en contado coincide con `amountCents`. */
|
|
26
|
+
/** Precio de lista del equipo; en contado coincide con `amountCents`. Sin equipo se omite. */
|
|
26
27
|
equipmentPriceCents?: number;
|
|
27
28
|
/** Enganche cobrado (solo `type=CREDIT`). */
|
|
28
29
|
downPaymentCents?: number;
|
|
@@ -23,7 +23,8 @@ export interface SaleCompletedV2 {
|
|
|
23
23
|
/** Quién vendió — el eje del cálculo de comisión. Es lo que más falta en la V1. */
|
|
24
24
|
sellerRetailUserId: string;
|
|
25
25
|
retailCustomerId: string;
|
|
26
|
-
|
|
26
|
+
/** `null` en la venta sin teléfono. */
|
|
27
|
+
sku: string | null;
|
|
27
28
|
/** Marca del equipo, del snapshot congelado al cerrar. `null` si no se pudo resolver. */
|
|
28
29
|
brand: string | null;
|
|
29
30
|
imei: string | null;
|
|
@@ -4,3 +4,16 @@ export declare const REWARD_ITEM_KEY_PATTERN: RegExp;
|
|
|
4
4
|
export declare const REWARD_ID_PATTERN: RegExp;
|
|
5
5
|
/** Máximo de ítems de un paquete (B-12 de rewards-business: presupuesto de tiempo del worker). Igual a `MAX_ITEMS_PER_PACKAGE` del lambda. */
|
|
6
6
|
export declare const REWARD_PACKAGE_MAX_ITEMS = 4;
|
|
7
|
+
/** Entregas de backoffice (Fase 4): ventana máxima del listado, default y tope del CSV. */
|
|
8
|
+
export declare const GRANTS_MAX_RANGE_DAYS = 92;
|
|
9
|
+
export declare const GRANTS_DEFAULT_RANGE_DAYS = 7;
|
|
10
|
+
export declare const GRANTS_EXPORT_MAX_ROWS = 5000;
|
|
11
|
+
/** Cierre mensual por aliado (D-C1): tope del CSV y formato de `month` (UTC). */
|
|
12
|
+
export declare const CHARGES_EXPORT_MAX_ROWS = 10000;
|
|
13
|
+
export declare const CHARGES_MONTH_PATTERN: RegExp;
|
|
14
|
+
/** Métricas de entregas (D-D3): top de 10, máximo 200 valores por dimensión, y etiquetas permitidas. */
|
|
15
|
+
export declare const METRICS_TOP_LIMIT = 10;
|
|
16
|
+
export declare const METRICS_TOP_MAX_VALUES = 200;
|
|
17
|
+
/** Etiquetas permitidas en métricas (D-D3b): una llave libre tendría cardinalidad ilimitada. */
|
|
18
|
+
export declare const METRICS_TAG_ALLOWLIST: readonly string[];
|
|
19
|
+
export declare const METRICS_TAG_DIMENSION_PATTERN: RegExp;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REWARD_PACKAGE_MAX_ITEMS = exports.REWARD_ID_PATTERN = exports.REWARD_ITEM_KEY_PATTERN = exports.REWARD_ITEM_KEY_MAX_LENGTH = void 0;
|
|
3
|
+
exports.METRICS_TAG_DIMENSION_PATTERN = exports.METRICS_TAG_ALLOWLIST = exports.METRICS_TOP_MAX_VALUES = exports.METRICS_TOP_LIMIT = exports.CHARGES_MONTH_PATTERN = exports.CHARGES_EXPORT_MAX_ROWS = exports.GRANTS_EXPORT_MAX_ROWS = exports.GRANTS_DEFAULT_RANGE_DAYS = exports.GRANTS_MAX_RANGE_DAYS = exports.REWARD_PACKAGE_MAX_ITEMS = exports.REWARD_ID_PATTERN = exports.REWARD_ITEM_KEY_PATTERN = exports.REWARD_ITEM_KEY_MAX_LENGTH = void 0;
|
|
4
4
|
/** Máximo del `itemKey` de un paquete: `RW-{grantId(32)}-{itemKey}` ≤ 64 (igual que REWARDS_MAX_ITEM_KEY_LENGTH de api-invoker). */
|
|
5
5
|
exports.REWARD_ITEM_KEY_MAX_LENGTH = 28;
|
|
6
6
|
exports.REWARD_ITEM_KEY_PATTERN = new RegExp(`^[A-Za-z0-9_-]{1,${exports.REWARD_ITEM_KEY_MAX_LENGTH}}$`);
|
|
7
7
|
exports.REWARD_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8
8
|
/** Máximo de ítems de un paquete (B-12 de rewards-business: presupuesto de tiempo del worker). Igual a `MAX_ITEMS_PER_PACKAGE` del lambda. */
|
|
9
9
|
exports.REWARD_PACKAGE_MAX_ITEMS = 4;
|
|
10
|
+
/** Entregas de backoffice (Fase 4): ventana máxima del listado, default y tope del CSV. */
|
|
11
|
+
exports.GRANTS_MAX_RANGE_DAYS = 92;
|
|
12
|
+
exports.GRANTS_DEFAULT_RANGE_DAYS = 7;
|
|
13
|
+
exports.GRANTS_EXPORT_MAX_ROWS = 5000;
|
|
14
|
+
/** Cierre mensual por aliado (D-C1): tope del CSV y formato de `month` (UTC). */
|
|
15
|
+
exports.CHARGES_EXPORT_MAX_ROWS = 10000;
|
|
16
|
+
exports.CHARGES_MONTH_PATTERN = /^\d{4}-(0[1-9]|1[0-2])$/;
|
|
17
|
+
/** Métricas de entregas (D-D3): top de 10, máximo 200 valores por dimensión, y etiquetas permitidas. */
|
|
18
|
+
exports.METRICS_TOP_LIMIT = 10;
|
|
19
|
+
exports.METRICS_TOP_MAX_VALUES = 200;
|
|
20
|
+
/** Etiquetas permitidas en métricas (D-D3b): una llave libre tendría cardinalidad ilimitada. */
|
|
21
|
+
exports.METRICS_TAG_ALLOWLIST = ['campaignId', 'evaluationId'];
|
|
22
|
+
exports.METRICS_TAG_DIMENSION_PATTERN = /^TAG#(campaignId|evaluationId)$/;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackofficeGrantAttemptResponse = void 0;
|
|
4
|
+
const GrantAttemptResponse_1 = require("../responses/GrantAttemptResponse");
|
|
5
|
+
class BackofficeGrantAttemptResponse extends GrantAttemptResponse_1.GrantAttemptResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.BackofficeGrantAttemptResponse = BackofficeGrantAttemptResponse;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GrantItemResponse } from '../responses/GrantItemResponse';
|
|
2
|
+
import { BackofficeGrantAttemptResponse } from './BackofficeGrantAttemptResponse';
|
|
3
|
+
export declare class BackofficeGrantItemResponse extends GrantItemResponse {
|
|
4
|
+
/** Nombre de la recompensa congelada en la entrega. */
|
|
5
|
+
name: string;
|
|
6
|
+
attempts: BackofficeGrantAttemptResponse[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackofficeGrantItemResponse = void 0;
|
|
4
|
+
const GrantItemResponse_1 = require("../responses/GrantItemResponse");
|
|
5
|
+
class BackofficeGrantItemResponse extends GrantItemResponse_1.GrantItemResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.BackofficeGrantItemResponse = BackofficeGrantItemResponse;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GrantResponse } from '../responses/GrantResponse';
|
|
2
|
+
import { BackofficeGrantItemResponse } from './BackofficeGrantItemResponse';
|
|
3
|
+
/** Sin `directoryName`: Directory no trae un campo de nombre confiable (Q2). Sin `requestSnapshot`/`providerResponse` (R2). */
|
|
4
|
+
export declare class BackofficeGrantResponse extends GrantResponse {
|
|
5
|
+
packageName?: string;
|
|
6
|
+
items: BackofficeGrantItemResponse[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackofficeGrantResponse = void 0;
|
|
4
|
+
const GrantResponse_1 = require("../responses/GrantResponse");
|
|
5
|
+
/** Sin `directoryName`: Directory no trae un campo de nombre confiable (Q2). Sin `requestSnapshot`/`providerResponse` (R2). */
|
|
6
|
+
class BackofficeGrantResponse extends GrantResponse_1.GrantResponse {
|
|
7
|
+
}
|
|
8
|
+
exports.BackofficeGrantResponse = BackofficeGrantResponse;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RewardChargeTo } from '../RewardChargeTo';
|
|
2
|
+
import { RewardCost } from '../RewardCost';
|
|
3
|
+
/** Un cargo = un ítem que quedó GRANTED, con el costo CONGELADO en la entrega (no el actual del catálogo). Sin `source` (R4 lo guarda, no se expone). */
|
|
4
|
+
export declare class ChargeRecord {
|
|
5
|
+
grantId: string;
|
|
6
|
+
itemKey: string;
|
|
7
|
+
/** Epoch en milisegundos (UTC). */
|
|
8
|
+
grantedAt: number;
|
|
9
|
+
directoryId: string;
|
|
10
|
+
catalogItemId: string;
|
|
11
|
+
catalogItemName: string;
|
|
12
|
+
campaignId?: string;
|
|
13
|
+
packageId: string;
|
|
14
|
+
cost: RewardCost;
|
|
15
|
+
chargeTo: RewardChargeTo;
|
|
16
|
+
externalRef?: Record<string, string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChargeRecord = void 0;
|
|
4
|
+
/** Un cargo = un ítem que quedó GRANTED, con el costo CONGELADO en la entrega (no el actual del catálogo). Sin `source` (R4 lo guarda, no se expone). */
|
|
5
|
+
class ChargeRecord {
|
|
6
|
+
}
|
|
7
|
+
exports.ChargeRecord = ChargeRecord;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChargesExportQuery = void 0;
|
|
4
|
+
/** Query params ya validados de `GET /charges/export`. `month` = `AAAA-MM` UTC. */
|
|
5
|
+
class ChargesExportQuery {
|
|
6
|
+
}
|
|
7
|
+
exports.ChargesExportQuery = ChargesExportQuery;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CurrencyId } from '../../../currency';
|
|
2
|
+
/** Un punto de la serie diaria. `date` = `AAAA-MM-DD` UTC. `costGranted` = `costGrantedMinor / 100` (nunca se suman monedas distintas). */
|
|
3
|
+
export declare class DeliveryMetricsPoint {
|
|
4
|
+
date: string;
|
|
5
|
+
currency: CurrencyId;
|
|
6
|
+
granted: number;
|
|
7
|
+
failed: number;
|
|
8
|
+
skipped: number;
|
|
9
|
+
grantsCompleted: number;
|
|
10
|
+
grantsPartial: number;
|
|
11
|
+
grantsFailed: number;
|
|
12
|
+
costGranted: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryMetricsPoint = void 0;
|
|
4
|
+
/** Un punto de la serie diaria. `date` = `AAAA-MM-DD` UTC. `costGranted` = `costGrantedMinor / 100` (nunca se suman monedas distintas). */
|
|
5
|
+
class DeliveryMetricsPoint {
|
|
6
|
+
}
|
|
7
|
+
exports.DeliveryMetricsPoint = DeliveryMetricsPoint;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CurrencyId } from '../../../currency';
|
|
2
|
+
/** Query params ya validados de `GET /metrics/deliveries`. `dimension` es un `DeliveryDimensionEnum` o `TAG#campaignId|TAG#evaluationId`. `from`/`to` = `AAAA-MM-DD` UTC. */
|
|
3
|
+
export declare class DeliveryMetricsQuery {
|
|
4
|
+
dimension: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
currency?: CurrencyId;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryMetricsQuery = void 0;
|
|
4
|
+
/** Query params ya validados de `GET /metrics/deliveries`. `dimension` es un `DeliveryDimensionEnum` o `TAG#campaignId|TAG#evaluationId`. `from`/`to` = `AAAA-MM-DD` UTC. */
|
|
5
|
+
class DeliveryMetricsQuery {
|
|
6
|
+
}
|
|
7
|
+
exports.DeliveryMetricsQuery = DeliveryMetricsQuery;
|