@trii/types 2.10.656 → 2.10.658

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.
Files changed (90) hide show
  1. package/dist/Collections/Api.d.ts +41 -0
  2. package/dist/Collections/Api.js +2 -0
  3. package/dist/Collections/Commission.d.ts +52 -0
  4. package/dist/Collections/Commission.js +10 -0
  5. package/dist/Collections/Common.d.ts +78 -0
  6. package/dist/Collections/Common.js +39 -0
  7. package/dist/Collections/Dashboard.d.ts +27 -0
  8. package/dist/Collections/Dashboard.js +2 -0
  9. package/dist/Collections/Debt.d.ts +97 -0
  10. package/dist/Collections/Debt.js +12 -0
  11. package/dist/Collections/Interest.d.ts +38 -0
  12. package/dist/Collections/Interest.js +25 -0
  13. package/dist/Collections/Payment.d.ts +87 -0
  14. package/dist/Collections/Payment.js +21 -0
  15. package/dist/Collections/PaymentPlan.d.ts +87 -0
  16. package/dist/Collections/PaymentPlan.js +21 -0
  17. package/dist/Collections/PaymentPlanConfiguration.d.ts +100 -0
  18. package/dist/Collections/PaymentPlanConfiguration.js +34 -0
  19. package/dist/Collections/Portfolio.d.ts +52 -0
  20. package/dist/Collections/Portfolio.js +12 -0
  21. package/dist/Collections/Promise.d.ts +49 -0
  22. package/dist/Collections/Promise.js +25 -0
  23. package/dist/Collections/index.d.ts +11 -0
  24. package/dist/Collections/index.js +27 -0
  25. package/dist/Common/Channels/Channel.d.ts +6 -1
  26. package/dist/Common/Channels/Channel.js +6 -1
  27. package/dist/Common/Channels/WhatsApp.d.ts +22 -0
  28. package/dist/Common/Channels/WhatsApp.js +7 -1
  29. package/dist/Common/Messages/Message.d.ts +9 -0
  30. package/dist/Common/Messages/Message.js +6 -1
  31. package/dist/Conversations/Conversation.d.ts +15 -0
  32. package/dist/Conversations/Conversation.js +8 -1
  33. package/dist/Reports/ScheduledReport.d.ts +146 -0
  34. package/dist/Reports/ScheduledReport.js +37 -1
  35. package/dist/Sales/Api.d.ts +40 -0
  36. package/dist/Sales/Api.js +2 -0
  37. package/dist/Sales/Common.d.ts +72 -0
  38. package/dist/Sales/Common.js +31 -0
  39. package/dist/Sales/Dashboard.d.ts +25 -0
  40. package/dist/Sales/Dashboard.js +2 -0
  41. package/dist/Sales/Lead.d.ts +99 -0
  42. package/dist/Sales/Lead.js +8 -0
  43. package/dist/Sales/index.d.ts +4 -0
  44. package/dist/Sales/index.js +20 -0
  45. package/dist/Spaces/spaces.d.ts +1 -0
  46. package/dist/Tickets/AI.d.ts +400 -0
  47. package/dist/Tickets/AI.js +113 -0
  48. package/dist/Tickets/AdvancedApi.d.ts +486 -0
  49. package/dist/Tickets/AdvancedApi.js +108 -0
  50. package/dist/Tickets/Api.d.ts +62 -0
  51. package/dist/Tickets/Api.js +8 -0
  52. package/dist/Tickets/Approval.d.ts +139 -0
  53. package/dist/Tickets/Approval.js +30 -0
  54. package/dist/Tickets/Automation.d.ts +237 -0
  55. package/dist/Tickets/Automation.js +74 -0
  56. package/dist/Tickets/Category.d.ts +25 -0
  57. package/dist/Tickets/Category.js +2 -0
  58. package/dist/Tickets/Common.d.ts +90 -0
  59. package/dist/Tickets/Common.js +38 -0
  60. package/dist/Tickets/Conversation.d.ts +68 -0
  61. package/dist/Tickets/Conversation.js +30 -0
  62. package/dist/Tickets/Dashboard.d.ts +408 -0
  63. package/dist/Tickets/Dashboard.js +206 -0
  64. package/dist/Tickets/Fields.d.ts +133 -0
  65. package/dist/Tickets/Fields.js +44 -0
  66. package/dist/Tickets/Layouts.d.ts +63 -0
  67. package/dist/Tickets/Layouts.js +22 -0
  68. package/dist/Tickets/Routing.d.ts +290 -0
  69. package/dist/Tickets/Routing.js +87 -0
  70. package/dist/Tickets/Satisfaction.d.ts +31 -0
  71. package/dist/Tickets/Satisfaction.js +9 -0
  72. package/dist/Tickets/Security.d.ts +302 -0
  73. package/dist/Tickets/Security.js +107 -0
  74. package/dist/Tickets/SelfService.d.ts +255 -0
  75. package/dist/Tickets/SelfService.js +56 -0
  76. package/dist/Tickets/Sla.d.ts +253 -0
  77. package/dist/Tickets/Sla.js +73 -0
  78. package/dist/Tickets/Task.d.ts +122 -0
  79. package/dist/Tickets/Task.js +17 -0
  80. package/dist/Tickets/Ticket.d.ts +133 -0
  81. package/dist/Tickets/Ticket.js +2 -0
  82. package/dist/Tickets/Views.d.ts +77 -0
  83. package/dist/Tickets/Views.js +23 -0
  84. package/dist/Tickets/Workflow.d.ts +109 -0
  85. package/dist/Tickets/Workflow.js +44 -0
  86. package/dist/Tickets/index.d.ts +20 -1
  87. package/dist/Tickets/index.js +20 -1
  88. package/dist/index.d.ts +2 -0
  89. package/dist/index.js +3 -1
  90. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ import { IDebt } from './Debt';
2
+ import { CollectionPropertyValue, DebtOrigin, DebtPriority, DebtStage } from './Common';
3
+ export interface IDebtFilter {
4
+ search?: string;
5
+ stages?: DebtStage[];
6
+ statusIds?: string[];
7
+ priorities?: DebtPriority[];
8
+ origins?: DebtOrigin[];
9
+ contactIds?: string[];
10
+ creditorIds?: string[];
11
+ portfolioIds?: string[];
12
+ batchIds?: string[];
13
+ assigneeIds?: string[];
14
+ dueFrom?: Date;
15
+ dueTo?: Date;
16
+ minimumDaysPastDue?: number;
17
+ fields?: {
18
+ fieldNameKey: string;
19
+ operator: string;
20
+ value?: CollectionPropertyValue;
21
+ }[];
22
+ }
23
+ export interface IDebtQuery {
24
+ cursor?: string;
25
+ limit?: number;
26
+ filter?: IDebtFilter;
27
+ sort?: {
28
+ fieldNameKey: string;
29
+ direction: 'ASC' | 'DESC';
30
+ }[];
31
+ }
32
+ export interface IDebtPage {
33
+ items: IDebt[];
34
+ nextCursor?: string;
35
+ hasMore: boolean;
36
+ }
37
+ export interface ITransitionDebtDto {
38
+ expectedVersion: number;
39
+ toStatusId: string;
40
+ comment?: string;
41
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ import { CollectionConditionOperator, CollectionPropertyValue, ICollectionAuditedEntity, ICollectionMoney } from './Common';
2
+ export declare enum CommissionBaseType {
3
+ TOTAL_COLLECTED = "TOTAL_COLLECTED",
4
+ PRINCIPAL_COLLECTED = "PRINCIPAL_COLLECTED",
5
+ INTEREST_COLLECTED = "INTEREST_COLLECTED",
6
+ FEES_COLLECTED = "FEES_COLLECTED"
7
+ }
8
+ export interface ICommissionCondition {
9
+ fieldNameKey: string;
10
+ operator: CollectionConditionOperator;
11
+ expectedValue?: CollectionPropertyValue;
12
+ }
13
+ export interface ICommissionTier {
14
+ id: string;
15
+ minimum?: ICollectionMoney;
16
+ maximum?: ICollectionMoney;
17
+ percentage: string;
18
+ }
19
+ export interface ICommissionRule extends ICollectionAuditedEntity {
20
+ ruleSetId: string;
21
+ name: string;
22
+ enabled: boolean;
23
+ order: number;
24
+ baseType: CommissionBaseType;
25
+ fixedPercentage?: string;
26
+ tiers?: ICommissionTier[];
27
+ conditions?: ICommissionCondition[];
28
+ validFrom?: Date;
29
+ validTo?: Date;
30
+ }
31
+ export interface ICommissionRuleSet extends ICollectionAuditedEntity {
32
+ portfolioId: string;
33
+ name: string;
34
+ enabled: boolean;
35
+ ruleIds: string[];
36
+ }
37
+ export interface IAgentCommissionResult {
38
+ id: string;
39
+ spaceId: string;
40
+ portfolioId: string;
41
+ paymentId: string;
42
+ userId: string;
43
+ ruleId: string;
44
+ ruleSnapshot?: string;
45
+ commissionBase: ICollectionMoney;
46
+ percentage: string;
47
+ commissionAmount: ICollectionMoney;
48
+ calculatedAt: Date;
49
+ adjustedAt?: Date;
50
+ adjustedBy?: string;
51
+ adjustmentReason?: string;
52
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommissionBaseType = void 0;
4
+ var CommissionBaseType;
5
+ (function (CommissionBaseType) {
6
+ CommissionBaseType["TOTAL_COLLECTED"] = "TOTAL_COLLECTED";
7
+ CommissionBaseType["PRINCIPAL_COLLECTED"] = "PRINCIPAL_COLLECTED";
8
+ CommissionBaseType["INTEREST_COLLECTED"] = "INTEREST_COLLECTED";
9
+ CommissionBaseType["FEES_COLLECTED"] = "FEES_COLLECTED";
10
+ })(CommissionBaseType || (exports.CommissionBaseType = CommissionBaseType = {}));
@@ -0,0 +1,78 @@
1
+ import { IContactInfo } from '../Contacts/contacts';
2
+ export interface ICollectionMoney {
3
+ amount: string;
4
+ currency: string;
5
+ }
6
+ export interface ICollectionAuditedEntity {
7
+ id: string;
8
+ spaceId: string;
9
+ createdAt: Date;
10
+ createdBy: string;
11
+ updatedAt?: Date;
12
+ updatedBy?: string;
13
+ deletedAt?: Date;
14
+ deletedBy?: string;
15
+ }
16
+ export declare enum DebtStage {
17
+ OPEN = "OPEN",
18
+ IN_NEGOTIATION = "IN_NEGOTIATION",
19
+ PAYMENT_PLAN = "PAYMENT_PLAN",
20
+ SETTLED = "SETTLED",
21
+ UNCOLLECTIBLE = "UNCOLLECTIBLE",
22
+ CANCELLED = "CANCELLED"
23
+ }
24
+ export declare enum DebtPriority {
25
+ LOW = "LOW",
26
+ MEDIUM = "MEDIUM",
27
+ HIGH = "HIGH",
28
+ URGENT = "URGENT"
29
+ }
30
+ export declare enum DebtOrigin {
31
+ IMPORT = "IMPORT",
32
+ API = "API",
33
+ MANUAL = "MANUAL",
34
+ AUTOMATION = "AUTOMATION"
35
+ }
36
+ export interface IDebtStatus extends ICollectionAuditedEntity {
37
+ name: string;
38
+ description?: string;
39
+ color?: string;
40
+ order: number;
41
+ stage: DebtStage;
42
+ isInitial: boolean;
43
+ isFinal: boolean;
44
+ enabled: boolean;
45
+ }
46
+ export type CollectionPropertyValue = string | number | boolean | Date | null | CollectionPropertyValue[] | {
47
+ [key: string]: CollectionPropertyValue;
48
+ };
49
+ export interface IDebtProperty {
50
+ nameKey: string;
51
+ value: CollectionPropertyValue;
52
+ }
53
+ export declare enum CollectionConditionOperator {
54
+ EQUALS = "EQUALS",
55
+ NOT_EQUALS = "NOT_EQUALS",
56
+ EXISTS = "EXISTS",
57
+ NOT_EXISTS = "NOT_EXISTS",
58
+ GREATER_THAN = "GREATER_THAN",
59
+ GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL",
60
+ LESS_THAN = "LESS_THAN",
61
+ LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL",
62
+ IN = "IN",
63
+ NOT_IN = "NOT_IN"
64
+ }
65
+ export interface ICollectionDateRange {
66
+ from: Date;
67
+ to: Date;
68
+ }
69
+ export interface ICollectionMetricPoint {
70
+ date: Date;
71
+ value: number;
72
+ }
73
+ export interface ICollectionMetricGroup {
74
+ key: string;
75
+ label: string;
76
+ value: number;
77
+ }
78
+ export type IDebtContactProjection = IContactInfo;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionConditionOperator = exports.DebtOrigin = exports.DebtPriority = exports.DebtStage = void 0;
4
+ var DebtStage;
5
+ (function (DebtStage) {
6
+ DebtStage["OPEN"] = "OPEN";
7
+ DebtStage["IN_NEGOTIATION"] = "IN_NEGOTIATION";
8
+ DebtStage["PAYMENT_PLAN"] = "PAYMENT_PLAN";
9
+ DebtStage["SETTLED"] = "SETTLED";
10
+ DebtStage["UNCOLLECTIBLE"] = "UNCOLLECTIBLE";
11
+ DebtStage["CANCELLED"] = "CANCELLED";
12
+ })(DebtStage || (exports.DebtStage = DebtStage = {}));
13
+ var DebtPriority;
14
+ (function (DebtPriority) {
15
+ DebtPriority["LOW"] = "LOW";
16
+ DebtPriority["MEDIUM"] = "MEDIUM";
17
+ DebtPriority["HIGH"] = "HIGH";
18
+ DebtPriority["URGENT"] = "URGENT";
19
+ })(DebtPriority || (exports.DebtPriority = DebtPriority = {}));
20
+ var DebtOrigin;
21
+ (function (DebtOrigin) {
22
+ DebtOrigin["IMPORT"] = "IMPORT";
23
+ DebtOrigin["API"] = "API";
24
+ DebtOrigin["MANUAL"] = "MANUAL";
25
+ DebtOrigin["AUTOMATION"] = "AUTOMATION";
26
+ })(DebtOrigin || (exports.DebtOrigin = DebtOrigin = {}));
27
+ var CollectionConditionOperator;
28
+ (function (CollectionConditionOperator) {
29
+ CollectionConditionOperator["EQUALS"] = "EQUALS";
30
+ CollectionConditionOperator["NOT_EQUALS"] = "NOT_EQUALS";
31
+ CollectionConditionOperator["EXISTS"] = "EXISTS";
32
+ CollectionConditionOperator["NOT_EXISTS"] = "NOT_EXISTS";
33
+ CollectionConditionOperator["GREATER_THAN"] = "GREATER_THAN";
34
+ CollectionConditionOperator["GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL";
35
+ CollectionConditionOperator["LESS_THAN"] = "LESS_THAN";
36
+ CollectionConditionOperator["LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL";
37
+ CollectionConditionOperator["IN"] = "IN";
38
+ CollectionConditionOperator["NOT_IN"] = "NOT_IN";
39
+ })(CollectionConditionOperator || (exports.CollectionConditionOperator = CollectionConditionOperator = {}));
@@ -0,0 +1,27 @@
1
+ import { ICollectionDateRange, ICollectionMoney, ICollectionMetricGroup, ICollectionMetricPoint } from './Common';
2
+ export interface ICollectionsDashboardFilter {
3
+ range: ICollectionDateRange;
4
+ creditorIds?: string[];
5
+ portfolioIds?: string[];
6
+ batchIds?: string[];
7
+ statusIds?: string[];
8
+ assigneeIds?: string[];
9
+ assignedGroupIds?: string[];
10
+ }
11
+ export interface ICollectionsDashboardMetrics {
12
+ range: ICollectionDateRange;
13
+ totalAssigned: ICollectionMoney;
14
+ outstandingBalance: ICollectionMoney;
15
+ collected: ICollectionMoney;
16
+ recoveryPercentage: number;
17
+ activePaymentPlans: number;
18
+ failedPaymentPlans: number;
19
+ pendingPromises: number;
20
+ brokenPromises: number;
21
+ generatedCommissions: ICollectionMoney;
22
+ collectedSeries: ICollectionMetricPoint[];
23
+ byPortfolio: ICollectionMetricGroup[];
24
+ byAgent: ICollectionMetricGroup[];
25
+ byStatus: ICollectionMetricGroup[];
26
+ byDaysPastDueRange: ICollectionMetricGroup[];
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,97 @@
1
+ import { ICollectionMoney, IDebtContactProjection, IDebtProperty, DebtOrigin, DebtPriority, DebtStage } from './Common';
2
+ export declare enum DebtProductType {
3
+ LOAN = "LOAN",
4
+ CREDIT_CARD = "CREDIT_CARD",
5
+ ACCOUNT = "ACCOUNT",
6
+ SERVICE = "SERVICE",
7
+ INVOICE = "INVOICE",
8
+ OTHER = "OTHER"
9
+ }
10
+ export interface IDebtBalanceBreakdown {
11
+ principal: ICollectionMoney;
12
+ compensatoryInterest?: ICollectionMoney;
13
+ penaltyInterest?: ICollectionMoney;
14
+ fees?: ICollectionMoney;
15
+ taxes?: ICollectionMoney;
16
+ discounts?: ICollectionMoney;
17
+ total: ICollectionMoney;
18
+ }
19
+ export interface IDebt {
20
+ id: string;
21
+ spaceId: string;
22
+ number: number;
23
+ title: string;
24
+ description?: string;
25
+ contactId: string;
26
+ contact?: IDebtContactProjection;
27
+ statusId: string;
28
+ stage: DebtStage;
29
+ priority: DebtPriority;
30
+ origin: DebtOrigin;
31
+ assigneeId?: string;
32
+ assignedGroupId?: string;
33
+ properties: IDebtProperty[];
34
+ version: number;
35
+ creditorId: string;
36
+ portfolioId: string;
37
+ batchId?: string;
38
+ productType: DebtProductType;
39
+ productName?: string;
40
+ productReference?: string;
41
+ originalAmount: ICollectionMoney;
42
+ currentBalance: ICollectionMoney;
43
+ balanceBreakdown?: IDebtBalanceBreakdown;
44
+ originatedAt?: Date;
45
+ dueAt: Date;
46
+ daysPastDue: number;
47
+ interestConfigurationId?: string;
48
+ activePaymentPlanId?: string;
49
+ sourceRowExternalId?: string;
50
+ createdAt: Date;
51
+ createdBy: string;
52
+ updatedAt?: Date;
53
+ updatedBy?: string;
54
+ deletedAt?: Date;
55
+ deletedBy?: string;
56
+ }
57
+ export interface ICreateDebtDto {
58
+ title: string;
59
+ description?: string;
60
+ contactId: string;
61
+ statusId?: string;
62
+ priority: DebtPriority;
63
+ origin: DebtOrigin;
64
+ assigneeId?: string;
65
+ assignedGroupId?: string;
66
+ properties?: IDebtProperty[];
67
+ source?: string;
68
+ idempotencyKey?: string;
69
+ creditorId: string;
70
+ portfolioId: string;
71
+ batchId?: string;
72
+ productType: DebtProductType;
73
+ productName?: string;
74
+ productReference?: string;
75
+ originalAmount: ICollectionMoney;
76
+ currentBalance?: ICollectionMoney;
77
+ balanceBreakdown?: IDebtBalanceBreakdown;
78
+ originatedAt?: Date;
79
+ dueAt: Date;
80
+ sourceRowExternalId?: string;
81
+ }
82
+ export interface IUpdateDebtDto {
83
+ expectedVersion: number;
84
+ title?: string;
85
+ description?: string;
86
+ priority?: DebtPriority;
87
+ assigneeId?: string;
88
+ assignedGroupId?: string;
89
+ properties?: IDebtProperty[];
90
+ productType?: DebtProductType;
91
+ productName?: string;
92
+ productReference?: string;
93
+ currentBalance?: ICollectionMoney;
94
+ balanceBreakdown?: IDebtBalanceBreakdown;
95
+ dueAt?: Date;
96
+ interestConfigurationId?: string;
97
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebtProductType = void 0;
4
+ var DebtProductType;
5
+ (function (DebtProductType) {
6
+ DebtProductType["LOAN"] = "LOAN";
7
+ DebtProductType["CREDIT_CARD"] = "CREDIT_CARD";
8
+ DebtProductType["ACCOUNT"] = "ACCOUNT";
9
+ DebtProductType["SERVICE"] = "SERVICE";
10
+ DebtProductType["INVOICE"] = "INVOICE";
11
+ DebtProductType["OTHER"] = "OTHER";
12
+ })(DebtProductType || (exports.DebtProductType = DebtProductType = {}));
@@ -0,0 +1,38 @@
1
+ import { ICollectionAuditedEntity } from './Common';
2
+ export declare enum InterestType {
3
+ COMPENSATORY = "COMPENSATORY",
4
+ PENALTY = "PENALTY"
5
+ }
6
+ export declare enum InterestCalculationMethod {
7
+ SIMPLE = "SIMPLE",
8
+ COMPOUND = "COMPOUND"
9
+ }
10
+ export declare enum InterestRatePeriod {
11
+ DAILY = "DAILY",
12
+ MONTHLY = "MONTHLY",
13
+ ANNUAL = "ANNUAL"
14
+ }
15
+ export declare enum InterestDayCountBasis {
16
+ ACTUAL_365 = "ACTUAL_365",
17
+ ACTUAL_360 = "ACTUAL_360",
18
+ THIRTY_360 = "THIRTY_360"
19
+ }
20
+ export interface IInterestRatePeriod {
21
+ rate: string;
22
+ period: InterestRatePeriod;
23
+ validFrom: Date;
24
+ validTo?: Date;
25
+ }
26
+ export interface IInterestComponentConfiguration {
27
+ type: InterestType;
28
+ method: InterestCalculationMethod;
29
+ dayCountBasis: InterestDayCountBasis;
30
+ capitalizationEnabled: boolean;
31
+ rates: IInterestRatePeriod[];
32
+ }
33
+ export interface IInterestConfiguration extends ICollectionAuditedEntity {
34
+ name: string;
35
+ description?: string;
36
+ enabled: boolean;
37
+ components: IInterestComponentConfiguration[];
38
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InterestDayCountBasis = exports.InterestRatePeriod = exports.InterestCalculationMethod = exports.InterestType = void 0;
4
+ var InterestType;
5
+ (function (InterestType) {
6
+ InterestType["COMPENSATORY"] = "COMPENSATORY";
7
+ InterestType["PENALTY"] = "PENALTY";
8
+ })(InterestType || (exports.InterestType = InterestType = {}));
9
+ var InterestCalculationMethod;
10
+ (function (InterestCalculationMethod) {
11
+ InterestCalculationMethod["SIMPLE"] = "SIMPLE";
12
+ InterestCalculationMethod["COMPOUND"] = "COMPOUND";
13
+ })(InterestCalculationMethod || (exports.InterestCalculationMethod = InterestCalculationMethod = {}));
14
+ var InterestRatePeriod;
15
+ (function (InterestRatePeriod) {
16
+ InterestRatePeriod["DAILY"] = "DAILY";
17
+ InterestRatePeriod["MONTHLY"] = "MONTHLY";
18
+ InterestRatePeriod["ANNUAL"] = "ANNUAL";
19
+ })(InterestRatePeriod || (exports.InterestRatePeriod = InterestRatePeriod = {}));
20
+ var InterestDayCountBasis;
21
+ (function (InterestDayCountBasis) {
22
+ InterestDayCountBasis["ACTUAL_365"] = "ACTUAL_365";
23
+ InterestDayCountBasis["ACTUAL_360"] = "ACTUAL_360";
24
+ InterestDayCountBasis["THIRTY_360"] = "THIRTY_360";
25
+ })(InterestDayCountBasis || (exports.InterestDayCountBasis = InterestDayCountBasis = {}));
@@ -0,0 +1,87 @@
1
+ import { ICollectionMoney } from './Common';
2
+ export declare enum DebtPaymentStatus {
3
+ PENDING = "PENDING",
4
+ CONFIRMED = "CONFIRMED",
5
+ REJECTED = "REJECTED",
6
+ REVERSED = "REVERSED"
7
+ }
8
+ export declare enum DebtPaymentMethod {
9
+ CASH = "CASH",
10
+ BANK_TRANSFER = "BANK_TRANSFER",
11
+ CREDIT_CARD = "CREDIT_CARD",
12
+ DEBIT_CARD = "DEBIT_CARD",
13
+ DIRECT_DEBIT = "DIRECT_DEBIT",
14
+ DIGITAL_WALLET = "DIGITAL_WALLET",
15
+ CHECK = "CHECK",
16
+ OTHER = "OTHER"
17
+ }
18
+ export interface IPaymentAllocation {
19
+ debtId: string;
20
+ installmentId?: string;
21
+ principal: ICollectionMoney;
22
+ compensatoryInterest?: ICollectionMoney;
23
+ penaltyInterest?: ICollectionMoney;
24
+ fees?: ICollectionMoney;
25
+ taxes?: ICollectionMoney;
26
+ discounts?: ICollectionMoney;
27
+ total: ICollectionMoney;
28
+ }
29
+ export interface IPaymentAgentAttribution {
30
+ userId: string;
31
+ percentage: string;
32
+ amount?: ICollectionMoney;
33
+ commissionRuleId?: string;
34
+ adjustedBy?: string;
35
+ adjustedAt?: Date;
36
+ adjustmentReason?: string;
37
+ }
38
+ export interface IDebtPayment {
39
+ id: string;
40
+ spaceId: string;
41
+ portfolioId: string;
42
+ contactId: string;
43
+ paymentPlanId?: string;
44
+ amount: ICollectionMoney;
45
+ paidAt: Date;
46
+ method: DebtPaymentMethod;
47
+ status: DebtPaymentStatus;
48
+ reference?: string;
49
+ allocations: IPaymentAllocation[];
50
+ agentAttributions: IPaymentAgentAttribution[];
51
+ externalReferences?: {
52
+ system: string;
53
+ externalId: string;
54
+ }[];
55
+ source?: string;
56
+ idempotencyKey?: string;
57
+ confirmedAt?: Date;
58
+ confirmedBy?: string;
59
+ createdAt: Date;
60
+ createdBy: string;
61
+ reversedByPaymentReversalId?: string;
62
+ }
63
+ export interface IDebtPaymentReversal {
64
+ id: string;
65
+ spaceId: string;
66
+ paymentId: string;
67
+ amount: ICollectionMoney;
68
+ reason: string;
69
+ allocations: IPaymentAllocation[];
70
+ reversedAt: Date;
71
+ reversedBy: string;
72
+ source?: string;
73
+ idempotencyKey?: string;
74
+ }
75
+ export interface ICreateDebtPaymentDto {
76
+ portfolioId: string;
77
+ contactId: string;
78
+ paymentPlanId?: string;
79
+ amount: ICollectionMoney;
80
+ paidAt: Date;
81
+ method: DebtPaymentMethod;
82
+ reference?: string;
83
+ allocations: IPaymentAllocation[];
84
+ agentAttributions: IPaymentAgentAttribution[];
85
+ source?: string;
86
+ idempotencyKey?: string;
87
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebtPaymentMethod = exports.DebtPaymentStatus = void 0;
4
+ var DebtPaymentStatus;
5
+ (function (DebtPaymentStatus) {
6
+ DebtPaymentStatus["PENDING"] = "PENDING";
7
+ DebtPaymentStatus["CONFIRMED"] = "CONFIRMED";
8
+ DebtPaymentStatus["REJECTED"] = "REJECTED";
9
+ DebtPaymentStatus["REVERSED"] = "REVERSED";
10
+ })(DebtPaymentStatus || (exports.DebtPaymentStatus = DebtPaymentStatus = {}));
11
+ var DebtPaymentMethod;
12
+ (function (DebtPaymentMethod) {
13
+ DebtPaymentMethod["CASH"] = "CASH";
14
+ DebtPaymentMethod["BANK_TRANSFER"] = "BANK_TRANSFER";
15
+ DebtPaymentMethod["CREDIT_CARD"] = "CREDIT_CARD";
16
+ DebtPaymentMethod["DEBIT_CARD"] = "DEBIT_CARD";
17
+ DebtPaymentMethod["DIRECT_DEBIT"] = "DIRECT_DEBIT";
18
+ DebtPaymentMethod["DIGITAL_WALLET"] = "DIGITAL_WALLET";
19
+ DebtPaymentMethod["CHECK"] = "CHECK";
20
+ DebtPaymentMethod["OTHER"] = "OTHER";
21
+ })(DebtPaymentMethod || (exports.DebtPaymentMethod = DebtPaymentMethod = {}));
@@ -0,0 +1,87 @@
1
+ import { ICollectionAuditedEntity, ICollectionMoney } from './Common';
2
+ import { IPaymentPlanConfigurationSnapshot, PaymentPlanFrequency } from './PaymentPlanConfiguration';
3
+ export declare enum PaymentPlanStatus {
4
+ DRAFT = "DRAFT",
5
+ PENDING_APPROVAL = "PENDING_APPROVAL",
6
+ ACTIVE = "ACTIVE",
7
+ COMPLETED = "COMPLETED",
8
+ FAILED = "FAILED",
9
+ CANCELLED = "CANCELLED",
10
+ REFINANCED = "REFINANCED"
11
+ }
12
+ export declare enum PaymentPlanInstallmentStatus {
13
+ PENDING = "PENDING",
14
+ PARTIALLY_PAID = "PARTIALLY_PAID",
15
+ PAID = "PAID",
16
+ OVERDUE = "OVERDUE",
17
+ CANCELLED = "CANCELLED"
18
+ }
19
+ export interface IPlannedDebtAllocation {
20
+ debtId: string;
21
+ principal: ICollectionMoney;
22
+ interest?: ICollectionMoney;
23
+ fees?: ICollectionMoney;
24
+ taxes?: ICollectionMoney;
25
+ discounts?: ICollectionMoney;
26
+ total: ICollectionMoney;
27
+ }
28
+ export interface IPaymentPlanInstallment {
29
+ id: string;
30
+ number: number;
31
+ dueAt: Date;
32
+ amount: ICollectionMoney;
33
+ paidAmount: ICollectionMoney;
34
+ status: PaymentPlanInstallmentStatus;
35
+ allocations?: IPlannedDebtAllocation[];
36
+ }
37
+ export interface IPaymentPlan extends ICollectionAuditedEntity {
38
+ portfolioId: string;
39
+ contactId: string;
40
+ debtIds: string[];
41
+ status: PaymentPlanStatus;
42
+ configurationId?: string;
43
+ configurationVersion?: number;
44
+ /** Immutable copy of every value and formula used to calculate this plan. */
45
+ configurationSnapshot?: IPaymentPlanConfigurationSnapshot;
46
+ totalAmount: ICollectionMoney;
47
+ downPayment?: ICollectionMoney;
48
+ interestConfigurationId?: string;
49
+ installments: IPaymentPlanInstallment[];
50
+ activatedAt?: Date;
51
+ completedAt?: Date;
52
+ failedAt?: Date;
53
+ failureReason?: string;
54
+ failurePolicyId?: string;
55
+ replacesPlanId?: string;
56
+ replacedByPlanId?: string;
57
+ approvedAt?: Date;
58
+ approvedBy?: string;
59
+ version: number;
60
+ }
61
+ export interface IPaymentPlanFailurePolicy extends ICollectionAuditedEntity {
62
+ name: string;
63
+ enabled: boolean;
64
+ maximumOverdueInstallments?: number;
65
+ gracePeriodDays?: number;
66
+ minimumOverdueAmount?: ICollectionMoney;
67
+ automaticFailure: boolean;
68
+ supervisorApprovalRequired: boolean;
69
+ }
70
+ export interface ICreatePaymentPlanDto {
71
+ portfolioId: string;
72
+ contactId: string;
73
+ debtIds: string[];
74
+ configurationId?: string;
75
+ installmentCount?: number;
76
+ firstDueAt?: Date;
77
+ frequency?: PaymentPlanFrequency;
78
+ customDueDates?: Date[];
79
+ totalAmount: ICollectionMoney;
80
+ downPayment?: ICollectionMoney;
81
+ interestConfigurationId?: string;
82
+ /** Optional for formula-generated plans; required for manually constructed plans. */
83
+ installments?: Omit<IPaymentPlanInstallment, 'id' | 'paidAmount' | 'status'>[];
84
+ replacesPlanId?: string;
85
+ source?: string;
86
+ idempotencyKey?: string;
87
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentPlanInstallmentStatus = exports.PaymentPlanStatus = void 0;
4
+ var PaymentPlanStatus;
5
+ (function (PaymentPlanStatus) {
6
+ PaymentPlanStatus["DRAFT"] = "DRAFT";
7
+ PaymentPlanStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
8
+ PaymentPlanStatus["ACTIVE"] = "ACTIVE";
9
+ PaymentPlanStatus["COMPLETED"] = "COMPLETED";
10
+ PaymentPlanStatus["FAILED"] = "FAILED";
11
+ PaymentPlanStatus["CANCELLED"] = "CANCELLED";
12
+ PaymentPlanStatus["REFINANCED"] = "REFINANCED";
13
+ })(PaymentPlanStatus || (exports.PaymentPlanStatus = PaymentPlanStatus = {}));
14
+ var PaymentPlanInstallmentStatus;
15
+ (function (PaymentPlanInstallmentStatus) {
16
+ PaymentPlanInstallmentStatus["PENDING"] = "PENDING";
17
+ PaymentPlanInstallmentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
18
+ PaymentPlanInstallmentStatus["PAID"] = "PAID";
19
+ PaymentPlanInstallmentStatus["OVERDUE"] = "OVERDUE";
20
+ PaymentPlanInstallmentStatus["CANCELLED"] = "CANCELLED";
21
+ })(PaymentPlanInstallmentStatus || (exports.PaymentPlanInstallmentStatus = PaymentPlanInstallmentStatus = {}));