@abyss-project/main 18.4.0 → 19.1.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.
Files changed (90) hide show
  1. package/dist/api/billing-account.admin.api.d.ts +3 -2
  2. package/dist/api/billing-account.admin.api.js +5 -1
  3. package/dist/api/billing-account.admin.api.js.map +1 -1
  4. package/dist/api/funding.admin.api.d.ts +25 -3
  5. package/dist/api/funding.admin.api.js +51 -7
  6. package/dist/api/funding.admin.api.js.map +1 -1
  7. package/dist/api/funding.api.d.ts +4 -1
  8. package/dist/api/funding.api.js +7 -1
  9. package/dist/api/funding.api.js.map +1 -1
  10. package/dist/api/organization-billing.api.d.ts +3 -2
  11. package/dist/api/organization-billing.api.js +5 -1
  12. package/dist/api/organization-billing.api.js.map +1 -1
  13. package/dist/api/tests/sdk-funding.spec.js +147 -9
  14. package/dist/api/tests/sdk-funding.spec.js.map +1 -1
  15. package/dist/billing-metric-label/billing-metric-label.labels.d.ts +2 -0
  16. package/dist/billing-metric-label/billing-metric-label.labels.js +2 -0
  17. package/dist/billing-metric-label/billing-metric-label.labels.js.map +1 -1
  18. package/dist/constants/billing-catalog.constants.js +10 -0
  19. package/dist/constants/billing-catalog.constants.js.map +1 -1
  20. package/dist/constants/catalog-plan-quotas.constants.js +3 -0
  21. package/dist/constants/catalog-plan-quotas.constants.js.map +1 -1
  22. package/dist/constants/enforcement-registry.constants.d.ts +1 -1
  23. package/dist/constants/enforcement-registry.constants.js +6 -0
  24. package/dist/constants/enforcement-registry.constants.js.map +1 -1
  25. package/dist/constants/metric-price-scale.constants.js +5 -0
  26. package/dist/constants/metric-price-scale.constants.js.map +1 -1
  27. package/dist/constants/module-catalog.constants.d.ts +1 -0
  28. package/dist/constants/module-catalog.constants.js +12 -0
  29. package/dist/constants/module-catalog.constants.js.map +1 -1
  30. package/dist/constants/overage-base-rates.constants.js +1 -0
  31. package/dist/constants/overage-base-rates.constants.js.map +1 -1
  32. package/dist/constants/public-plans.constants.js +39 -0
  33. package/dist/constants/public-plans.constants.js.map +1 -1
  34. package/dist/constants/quota-metric-kind.constants.js +1 -0
  35. package/dist/constants/quota-metric-kind.constants.js.map +1 -1
  36. package/dist/constants/tests/module-calibration.constants.spec.js +1 -0
  37. package/dist/constants/tests/module-calibration.constants.spec.js.map +1 -1
  38. package/dist/constants/tests/module-catalog.constants.spec.js +2 -2
  39. package/dist/constants/tests/module-catalog.constants.spec.js.map +1 -1
  40. package/dist/funding-criteria.d.ts +14 -0
  41. package/dist/funding-criteria.js +73 -0
  42. package/dist/funding-criteria.js.map +1 -0
  43. package/dist/index.d.ts +30 -2
  44. package/dist/index.js +30 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/translate/en.translate.d.ts +12 -0
  47. package/dist/translate/en.translate.js +12 -0
  48. package/dist/translate/en.translate.js.map +1 -1
  49. package/dist/translate/fr.translate.d.ts +12 -0
  50. package/dist/translate/fr.translate.js +12 -0
  51. package/dist/translate/fr.translate.js.map +1 -1
  52. package/dist/translate/tests/funding-notifications.spec.js +24 -4
  53. package/dist/translate/tests/funding-notifications.spec.js.map +1 -1
  54. package/dist/types/enum/api-error.enum.d.ts +2 -0
  55. package/dist/types/enum/api-error.enum.js +2 -0
  56. package/dist/types/enum/api-error.enum.js.map +1 -1
  57. package/dist/types/enum/email-type.enum.d.ts +3 -0
  58. package/dist/types/enum/email-type.enum.js +3 -0
  59. package/dist/types/enum/email-type.enum.js.map +1 -1
  60. package/dist/types/enum/funding.enum.d.ts +61 -4
  61. package/dist/types/enum/funding.enum.js +71 -2
  62. package/dist/types/enum/funding.enum.js.map +1 -1
  63. package/dist/types/enum/organization-billing.enum.d.ts +2 -0
  64. package/dist/types/enum/organization-billing.enum.js +2 -0
  65. package/dist/types/enum/organization-billing.enum.js.map +1 -1
  66. package/dist/types/enum/user-notification-category.enum.js +3 -0
  67. package/dist/types/enum/user-notification-category.enum.js.map +1 -1
  68. package/dist/types/enum/user-notification-content-type.enum.d.ts +23 -0
  69. package/dist/types/enum/user-notification-content-type.enum.js +4 -1
  70. package/dist/types/enum/user-notification-content-type.enum.js.map +1 -1
  71. package/dist/types/interface/api/requests/billing-account.admin.request.d.ts +4 -0
  72. package/dist/types/interface/api/requests/funding.admin.request.d.ts +70 -14
  73. package/dist/types/interface/api/requests/funding.request.d.ts +8 -1
  74. package/dist/types/interface/api/requests/organization-billing.request.d.ts +4 -0
  75. package/dist/types/interface/api/responses/billing-account.admin.response.d.ts +15 -0
  76. package/dist/types/interface/api/responses/funding.admin.response.d.ts +80 -7
  77. package/dist/types/interface/api/responses/funding.response.d.ts +27 -1
  78. package/dist/types/interface/api/responses/organization-billing.response.d.ts +6 -0
  79. package/dist/types/interface/models/funding.model.d.ts +189 -12
  80. package/dist/types/interface/models/funding.model.js +15 -1
  81. package/dist/types/interface/models/funding.model.js.map +1 -1
  82. package/dist/types/interface/models/support-ticket-attachment.model.d.ts +0 -1
  83. package/dist/utils/invoice-amounts.utils.d.ts +2 -1
  84. package/dist/utils/invoice-amounts.utils.js +10 -11
  85. package/dist/utils/invoice-amounts.utils.js.map +1 -1
  86. package/dist/utils/invoice-line-label.utils.js +1 -0
  87. package/dist/utils/invoice-line-label.utils.js.map +1 -1
  88. package/dist/utils/tests/invoice-amounts.utils.spec.js +15 -0
  89. package/dist/utils/tests/invoice-amounts.utils.spec.js.map +1 -1
  90. package/package.json +1 -1
@@ -161,6 +161,10 @@ export interface IResolveQuotaOrganizationBody {
161
161
  userId: string;
162
162
  teamIds?: string[];
163
163
  }
164
+ export interface IGetInvoiceOrganizationParams {
165
+ organizationId: string;
166
+ invoiceId: string;
167
+ }
164
168
  export interface IDownloadOrgInvoicePdfParams {
165
169
  organizationId: string;
166
170
  invoiceId: string;
@@ -6,6 +6,10 @@ import { ICommercialGesture } from '../../models/commercial-gesture.model';
6
6
  import { ICreditTransaction } from '../../models/credit-transaction.model';
7
7
  import { IEurTransaction } from '../../models/eur-transaction.model';
8
8
  import { IInvoice } from '../../models/invoice.model';
9
+ import { IInvoiceLine } from '../../models/invoice-line.model';
10
+ import { ICreditNote } from '../../models/credit-note.model';
11
+ import type { IFundingInvoiceCoverage } from '../../models/funding.model';
12
+ import type { IInvoiceAmounts } from '../../../../utils/invoice-amounts.utils';
9
13
  import { IServiceQuota } from '../../models/organization-service-quota.model';
10
14
  import { IPlanTemplate } from '../../models/plan-template.model';
11
15
  import { IResponse } from '../type-message/response';
@@ -78,6 +82,17 @@ export interface IListInvoicesAdminBillingData {
78
82
  invoices: IInvoice[];
79
83
  }
80
84
  export type IListInvoicesAdminBillingResponse = IResponse<IListInvoicesAdminBillingData>;
85
+ export interface IAdminInvoiceDetail extends Omit<IInvoice, 'lines' | 'commercialGestures' | 'creditNotes'> {
86
+ lines: IInvoiceLine[];
87
+ commercialGestures: ICommercialGesture[];
88
+ creditNotes: ICreditNote[];
89
+ amounts: IInvoiceAmounts;
90
+ }
91
+ export interface IGetInvoiceAdminBillingData {
92
+ invoice: IAdminInvoiceDetail;
93
+ fundingCoverage: IFundingInvoiceCoverage[];
94
+ }
95
+ export type IGetInvoiceAdminBillingResponse = IResponse<IGetInvoiceAdminBillingData>;
81
96
  export interface IUpdateInvoiceAdminBillingData {
82
97
  invoice: IInvoice;
83
98
  }
@@ -1,7 +1,8 @@
1
- import type { IFundingEligibility, IFundingProgramme, IFundingProgrammeSettings, IFundingProposalState } from '../../models/funding.model';
1
+ import type { IFundingAction, IFundingAllocation, IFundingConditionsPublishCandidate, IFundingConditionsTemplate, IFundingConditionsTransition, IFundingConditionsVersion, IFundingEligibility, IFundingOfferTemplate, IFundingProgramme, IFundingProgrammeEvent, IFundingProgrammeSettings, IFundingProgrammeStatement } from '../../models/funding.model';
2
2
  import type { IOrganization } from '../../models/organization.model';
3
3
  import { BasePaginate } from '../type-message/base-paginate';
4
4
  import { IResponse } from '../type-message/response';
5
+ import type { IFundingProgrammeContract, IFundingProgrammeSummary } from './funding.response';
5
6
  export interface IFundingSuggestion {
6
7
  baseCents: number;
7
8
  bonusSirenVerifiedCents: number;
@@ -14,13 +15,28 @@ export interface ICountToProcessFundingAdminData {
14
15
  count: number;
15
16
  }
16
17
  export type ICountToProcessFundingAdminResponse = IResponse<ICountToProcessFundingAdminData>;
17
- export interface IFundingEligibleOrganization {
18
+ export interface IFundingAdminStats {
19
+ activeProgrammes: number;
20
+ atRiskProgrammes: number;
21
+ creditsEngagedCents: number;
22
+ creditsConsumedCents: number;
23
+ offeredPlansInProgress: number;
24
+ offeredPlansValueCents: number;
25
+ pendingOffers: number;
26
+ oldestPendingOfferDays: number | null;
27
+ }
28
+ export interface IGetStatsFundingAdminData {
29
+ stats: IFundingAdminStats;
30
+ }
31
+ export type IGetStatsFundingAdminResponse = IResponse<IGetStatsFundingAdminData>;
32
+ export interface IFundingAdminOrganization {
18
33
  organization: IOrganization;
19
- eligibility: IFundingEligibility;
20
- suggestion: IFundingSuggestion;
21
- proposalState: IFundingProposalState | null;
34
+ eligibility: IFundingEligibility | null;
35
+ latestProgramme: IFundingProgramme | null;
36
+ programmeCount: number;
37
+ totalGainCents: number;
22
38
  }
23
- export type IPaginateEligibleFundingAdminResponse = IResponse<BasePaginate<IFundingEligibleOrganization>>;
39
+ export type IPaginateOrganizationsFundingAdminResponse = IResponse<BasePaginate<IFundingAdminOrganization>>;
24
40
  export interface IGetProgrammeFundingAdminData {
25
41
  programme: IFundingProgramme;
26
42
  eligibility: IFundingEligibility | null;
@@ -45,7 +61,6 @@ export type IWithdrawOfferFundingAdminResponse = IFundingProgrammeAdminResponse;
45
61
  export type IRejectFundingAdminResponse = IFundingProgrammeAdminResponse;
46
62
  export type IExtendGraceFundingAdminResponse = IFundingProgrammeAdminResponse;
47
63
  export type IRevokeFundingAdminResponse = IFundingProgrammeAdminResponse;
48
- export type IUpdateThresholdsFundingAdminResponse = IFundingProgrammeAdminResponse;
49
64
  export interface IMarkLegalDocsReviewedFundingAdminData {
50
65
  organization: IOrganization;
51
66
  }
@@ -55,3 +70,61 @@ export interface IFundingSettingsAdminData {
55
70
  }
56
71
  export type IGetSettingsFundingAdminResponse = IResponse<IFundingSettingsAdminData>;
57
72
  export type IUpdateSettingsFundingAdminResponse = IResponse<IFundingSettingsAdminData>;
73
+ export type IUpdateFollowUpFundingAdminResponse = IFundingProgrammeAdminResponse;
74
+ export type IDismissFollowUpFundingAdminResponse = IFundingProgrammeAdminResponse;
75
+ export type IGetContractFundingAdminData = IFundingProgrammeContract<IFundingProgramme, IFundingProgrammeEvent, IFundingConditionsVersion, IFundingConditionsTransition>;
76
+ export type IGetContractFundingAdminResponse = IResponse<IGetContractFundingAdminData>;
77
+ export interface IGetStatementFundingAdminData {
78
+ statement: IFundingProgrammeStatement;
79
+ allocations: BasePaginate<IFundingAllocation>;
80
+ }
81
+ export type IGetStatementFundingAdminResponse = IResponse<IGetStatementFundingAdminData>;
82
+ export interface IListOrganizationProgrammesFundingAdminData {
83
+ programmes: IFundingProgrammeSummary<IFundingProgramme>[];
84
+ memberCount: number;
85
+ invoiceCount: number;
86
+ }
87
+ export type IListOrganizationProgrammesFundingAdminResponse = IResponse<IListOrganizationProgrammesFundingAdminData>;
88
+ export interface IListActionsFundingAdminData {
89
+ actions: IFundingAction[];
90
+ }
91
+ export type IListActionsFundingAdminResponse = IResponse<IListActionsFundingAdminData>;
92
+ export interface IFundingConditionsSchedulingAdminData {
93
+ version: IFundingConditionsVersion;
94
+ transitions: IFundingConditionsTransition[];
95
+ }
96
+ export type IPublishConditionsFundingAdminResponse = IResponse<IFundingConditionsSchedulingAdminData>;
97
+ export type IAdaptConditionsFundingAdminResponse = IResponse<IFundingConditionsSchedulingAdminData>;
98
+ export interface ICancelConditionsTransitionFundingAdminData {
99
+ transition: IFundingConditionsTransition;
100
+ }
101
+ export type ICancelConditionsTransitionFundingAdminResponse = IResponse<ICancelConditionsTransitionFundingAdminData>;
102
+ export interface IListConditionsTemplatesFundingAdminData {
103
+ templates: IFundingConditionsTemplate[];
104
+ }
105
+ export type IListConditionsTemplatesFundingAdminResponse = IResponse<IListConditionsTemplatesFundingAdminData>;
106
+ export interface IFundingConditionsTemplateAdminData {
107
+ template: IFundingConditionsTemplate;
108
+ }
109
+ export type IGetConditionsTemplateFundingAdminResponse = IResponse<IFundingConditionsTemplateAdminData>;
110
+ export type ICreateConditionsTemplateFundingAdminResponse = IResponse<IFundingConditionsTemplateAdminData>;
111
+ export type IArchiveConditionsTemplateFundingAdminResponse = IResponse<IFundingConditionsTemplateAdminData>;
112
+ export interface IFundingConditionsVersionAdminData {
113
+ version: IFundingConditionsVersion;
114
+ }
115
+ export type ICreateConditionsDraftFundingAdminResponse = IResponse<IFundingConditionsVersionAdminData>;
116
+ export type IUpdateConditionsDraftFundingAdminResponse = IResponse<IFundingConditionsVersionAdminData>;
117
+ export interface IPreviewConditionsPublishFundingAdminData {
118
+ candidates: IFundingConditionsPublishCandidate[];
119
+ }
120
+ export type IPreviewConditionsPublishFundingAdminResponse = IResponse<IPreviewConditionsPublishFundingAdminData>;
121
+ export interface IListOfferTemplatesFundingAdminData {
122
+ templates: IFundingOfferTemplate[];
123
+ }
124
+ export type IListOfferTemplatesFundingAdminResponse = IResponse<IListOfferTemplatesFundingAdminData>;
125
+ export interface IFundingOfferTemplateAdminData {
126
+ template: IFundingOfferTemplate;
127
+ }
128
+ export type ICreateOfferTemplateFundingAdminResponse = IResponse<IFundingOfferTemplateAdminData>;
129
+ export type IUpdateOfferTemplateFundingAdminResponse = IResponse<IFundingOfferTemplateAdminData>;
130
+ export type IArchiveOfferTemplateFundingAdminResponse = IResponse<IFundingOfferTemplateAdminData>;
@@ -1,4 +1,5 @@
1
- import type { IFundingEligibility, IFundingEnvelope, IFundingProgrammeEventUser, IFundingProgrammeUser } from '../../models/funding.model';
1
+ import type { IFundingAllocationUser, IFundingConditionsTransitionUser, IFundingConditionsVersionUser, IFundingEligibility, IFundingEnvelope, IFundingProgrammeEventUser, IFundingProgrammeStatement, IFundingProgrammeUser } from '../../models/funding.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
2
3
  import { IResponse } from '../type-message/response';
3
4
  export interface IFundingConditions {
4
5
  version: number;
@@ -25,3 +26,28 @@ export type IDeclineFundingUserResponse = IFundingProgrammeUserResponse;
25
26
  export type IRequestRenewalFundingUserResponse = IFundingProgrammeUserResponse;
26
27
  export type IKeepPlanFundingUserResponse = IFundingProgrammeUserResponse;
27
28
  export type IWithdrawFundingUserResponse = IFundingProgrammeUserResponse;
29
+ export interface IFundingProgrammeSummary<P extends IFundingProgrammeUser = IFundingProgrammeUser> {
30
+ programme: P;
31
+ statement: IFundingProgrammeStatement;
32
+ }
33
+ export interface IFundingPendingConditionsTransition<T extends IFundingConditionsTransitionUser = IFundingConditionsTransitionUser, V extends IFundingConditionsVersionUser = IFundingConditionsVersionUser> {
34
+ transition: T;
35
+ fromVersion: V;
36
+ toVersion: V;
37
+ }
38
+ export interface IFundingProgrammeContract<P extends IFundingProgrammeUser = IFundingProgrammeUser, E extends IFundingProgrammeEventUser = IFundingProgrammeEventUser, V extends IFundingConditionsVersionUser = IFundingConditionsVersionUser, T extends IFundingConditionsTransitionUser = IFundingConditionsTransitionUser> {
39
+ programme: P;
40
+ acceptedConditions: V | null;
41
+ conditionsInForce: V | null;
42
+ pendingTransition: IFundingPendingConditionsTransition<T, V> | null;
43
+ envelopes: IFundingEnvelope[];
44
+ events: E[];
45
+ statement: IFundingProgrammeStatement;
46
+ }
47
+ export interface IListProgrammesFundingUserData {
48
+ programmes: IFundingProgrammeSummary[];
49
+ }
50
+ export type IListProgrammesFundingUserResponse = IResponse<IListProgrammesFundingUserData>;
51
+ export type IGetProgrammeFundingUserData = IFundingProgrammeContract;
52
+ export type IGetProgrammeFundingUserResponse = IResponse<IGetProgrammeFundingUserData>;
53
+ export type IListAllocationsFundingUserResponse = IResponse<BasePaginate<IFundingAllocationUser>>;
@@ -6,6 +6,7 @@ import { IInvoice, IInvoiceCommercialGestureRequest } from '../../models/invoice
6
6
  import { IInvoiceLine } from '../../models/invoice-line.model';
7
7
  import { ICommercialGesture } from '../../models/commercial-gesture.model';
8
8
  import { ICreditNote } from '../../models/credit-note.model';
9
+ import type { IFundingInvoiceCoverage } from '../../models/funding.model';
9
10
  import type { IInvoiceAmounts } from '../../../../utils/invoice-amounts.utils';
10
11
  import { IProjectQuota } from '../../models/organization-project-quota.model';
11
12
  import { IUsageRecord } from '../../models/usage-record.model';
@@ -50,6 +51,11 @@ export interface ICustomerInvoice extends Omit<IInvoice, 'lines' | 'commercialGe
50
51
  amounts: IInvoiceAmounts;
51
52
  commercialGestureRequest: IInvoiceCommercialGestureRequest;
52
53
  }
54
+ export interface IGetInvoiceOrganizationData {
55
+ invoice: ICustomerInvoice;
56
+ fundingCoverage: IFundingInvoiceCoverage[];
57
+ }
58
+ export type IGetInvoiceOrganizationResponse = IResponse<IGetInvoiceOrganizationData>;
53
59
  export interface IListInvoicesOrganizationData {
54
60
  invoices: ICustomerInvoice[];
55
61
  }
@@ -1,11 +1,11 @@
1
- import { FundingCriterionKey, FundingEnvelopeStatus, FundingPlanGrantStatus, FundingProgrammeActorType, FundingProgrammeCloseReason, FundingProgrammeEntryPoint, FundingProgrammeEventType, FundingProgrammeStatus } from '../../enum';
1
+ import { FundingActionKind, FundingAllocationKind, FundingConditionsPublishBlockReason, FundingConditionsVersionStatus, FundingCriterionKey, FundingEnvelopeStatus, FundingFollowUpMode, FundingOfferAmountMode, FundingPlanGrantStatus, FundingProgrammeActorType, FundingProgrammeCloseReason, FundingProgrammeEntryPoint, FundingProgrammeEventType, FundingProgrammeStatus } from '../../enum';
2
2
  import type { IBillingAccount } from './billing-account.model';
3
3
  import type { IOrganization } from './organization.model';
4
4
  import type { IPlanTemplate } from './plan-template.model';
5
5
  import type { ISupportTicket } from './support-ticket.model';
6
- export interface IFundingThresholds {
7
- spotlightInactivityDays: number;
8
- minActivityScore: number;
6
+ export interface IFundingRule {
7
+ key: FundingCriterionKey;
8
+ params: Record<string, number>;
9
9
  }
10
10
  export interface IFundingCriterion {
11
11
  key: FundingCriterionKey;
@@ -25,7 +25,7 @@ export interface IFundingOffer {
25
25
  envelopeEndsAt: string;
26
26
  offeredPlanTemplateId: string | null;
27
27
  offeredPlanMonths: number | null;
28
- conditionsVersion: number;
28
+ conditionsVersionId: string;
29
29
  messageToClient: string | null;
30
30
  suggestedAmountCents: number;
31
31
  validUntil: string;
@@ -38,14 +38,16 @@ export interface IFundingProgramme {
38
38
  entryPoint: FundingProgrammeEntryPoint;
39
39
  supportTicketId: string | null;
40
40
  renewalOfId: string | null;
41
- thresholds: IFundingThresholds;
41
+ sequenceNumber: number;
42
+ offerTemplateId: string | null;
43
+ conditionsVersionId: string | null;
42
44
  eligibilitySnapshot: IFundingEligibilitySnapshot | null;
43
45
  offer: IFundingOffer | null;
44
46
  offerSentAt: Date | null;
45
47
  offerSentByAdminId: string | null;
46
48
  acceptedAt: Date | null;
47
49
  acceptedByUserId: string | null;
48
- acceptedConditionsVersion: number | null;
50
+ acceptedConditionsVersionId: string | null;
49
51
  startedAt: Date | null;
50
52
  endsAt: Date | null;
51
53
  atRiskSince: Date | null;
@@ -61,6 +63,11 @@ export interface IFundingProgramme {
61
63
  planGrantError: string | null;
62
64
  offeredPlanKeptAt: Date | null;
63
65
  offeredPlanRevertedAt: Date | null;
66
+ followUpMode: FundingFollowUpMode;
67
+ followUpDelayMonths: number | null;
68
+ followUpDueAt: Date | null;
69
+ followUpTriggeredAt: Date | null;
70
+ followUpProgrammeId: string | null;
64
71
  updatedAt?: Date;
65
72
  createdAt?: Date;
66
73
  organization?: IOrganization | null;
@@ -70,8 +77,12 @@ export interface IFundingProgramme {
70
77
  previousPlanTemplate?: IPlanTemplate | null;
71
78
  events?: IFundingProgrammeEvent[];
72
79
  envelopes?: IFundingEnvelope[];
80
+ offerTemplate?: IFundingOfferTemplate | null;
81
+ conditionsVersion?: IFundingConditionsVersion | null;
82
+ acceptedConditionsVersion?: IFundingConditionsVersion | null;
83
+ followUpProgramme?: IFundingProgramme | null;
73
84
  }
74
- export declare const FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES: readonly ["internalNote", "planGrantError", "stripeCouponId", "offerSentByAdminId"];
85
+ export declare const FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES: readonly ["internalNote", "planGrantError", "stripeCouponId", "offerSentByAdminId", "followUpMode", "followUpDelayMonths", "followUpDueAt", "followUpTriggeredAt", "followUpProgrammeId"];
75
86
  export type IFundingProgrammeUser = Omit<IFundingProgramme, typeof FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES[number]>;
76
87
  export type IFundingProgrammeEventData = Record<string, string | number | boolean | null | string[]>;
77
88
  export interface IFundingProgrammeEvent {
@@ -126,16 +137,182 @@ export interface IFundingProgrammeSettings {
126
137
  bonusLegalDocsCents: number;
127
138
  bonusActivityCents: number;
128
139
  bonusActivityMinScore: number;
129
- defaultThresholds: IFundingThresholds;
130
140
  defaultEnvelopeMonths: number;
131
141
  offerValidityDays: number;
132
142
  graceDays: number;
133
143
  reproposalDelayDays: number;
134
144
  maxProposals: number;
135
- conditionsVersion: number;
136
- conditionsTextFr: string;
137
- conditionsTextEn: string;
145
+ defaultConditionsTemplateId: string | null;
146
+ defaultTransitionNoticeDays: number;
147
+ detailedAllocationsSince: Date | null;
138
148
  updatedByAdminId: string | null;
139
149
  updatedAt?: Date;
140
150
  createdAt?: Date;
141
151
  }
152
+ export interface IFundingConditionsTemplate {
153
+ id?: string;
154
+ name: string;
155
+ description: string | null;
156
+ archivedAt: Date | null;
157
+ updatedAt?: Date;
158
+ createdAt?: Date;
159
+ versions?: IFundingConditionsVersion[];
160
+ }
161
+ export interface IFundingConditionsVersion {
162
+ id?: string;
163
+ templateId: string;
164
+ version: number;
165
+ status: FundingConditionsVersionStatus;
166
+ programmeId: string | null;
167
+ basedOnVersionId: string | null;
168
+ rules: IFundingRule[];
169
+ gracePeriodDays: number;
170
+ textFr: string;
171
+ textEn: string;
172
+ publishedAt: Date | null;
173
+ publishedByAdminId: string | null;
174
+ updatedAt?: Date;
175
+ createdAt?: Date;
176
+ template?: IFundingConditionsTemplate;
177
+ basedOnVersion?: IFundingConditionsVersion | null;
178
+ }
179
+ export declare const FUNDING_CONDITIONS_VERSION_INTERNAL_ATTRIBUTES: readonly ["publishedByAdminId"];
180
+ export type IFundingConditionsVersionUser = Omit<IFundingConditionsVersion, typeof FUNDING_CONDITIONS_VERSION_INTERNAL_ATTRIBUTES[number] | 'template' | 'basedOnVersion'>;
181
+ export interface IFundingOfferTemplate {
182
+ id?: string;
183
+ name: string;
184
+ amountMode: FundingOfferAmountMode;
185
+ amountCents: number | null;
186
+ envelopeMonths: number;
187
+ offeredPlanTemplateId: string | null;
188
+ offeredPlanMonths: number | null;
189
+ conditionsTemplateId: string;
190
+ followUpMode: FundingFollowUpMode;
191
+ followUpDelayMonths: number | null;
192
+ archivedAt: Date | null;
193
+ updatedAt?: Date;
194
+ createdAt?: Date;
195
+ offeredPlanTemplate?: IPlanTemplate | null;
196
+ conditionsTemplate?: IFundingConditionsTemplate;
197
+ }
198
+ export interface IFundingConditionsTransition {
199
+ id?: string;
200
+ programmeId: string;
201
+ fromVersionId: string;
202
+ toVersionId: string;
203
+ noticeDays: number;
204
+ notifiedAt: Date | null;
205
+ effectiveAt: Date;
206
+ appliedAt: Date | null;
207
+ cancelledAt: Date | null;
208
+ createdByAdminId: string | null;
209
+ createdAt?: Date;
210
+ programme?: IFundingProgramme;
211
+ fromVersion?: IFundingConditionsVersion;
212
+ toVersion?: IFundingConditionsVersion;
213
+ }
214
+ export declare const FUNDING_CONDITIONS_TRANSITION_INTERNAL_ATTRIBUTES: readonly ["createdByAdminId"];
215
+ export type IFundingConditionsTransitionUser = Omit<IFundingConditionsTransition, typeof FUNDING_CONDITIONS_TRANSITION_INTERNAL_ATTRIBUTES[number] | 'programme' | 'fromVersion' | 'toVersion'>;
216
+ export interface IFundingRulesMet {
217
+ met: number;
218
+ total: number;
219
+ failing: FundingCriterionKey[];
220
+ }
221
+ export interface IFundingConditionsPublishCandidate {
222
+ programmeId: string;
223
+ organizationId: string | null;
224
+ organizationName: string | null;
225
+ currentVersion: number;
226
+ rulesMetToday: IFundingRulesMet;
227
+ selectable: boolean;
228
+ reason: FundingConditionsPublishBlockReason | null;
229
+ }
230
+ export interface IFundingAllocation {
231
+ id?: string;
232
+ programmeId: string;
233
+ envelopeId: string | null;
234
+ billingAccountId: string;
235
+ kind: FundingAllocationKind;
236
+ invoiceId: string | null;
237
+ walletLedgerEntryId: string | null;
238
+ stripeInvoiceId: string | null;
239
+ amountCents: number;
240
+ occurredAt: Date;
241
+ createdAt?: Date;
242
+ programme?: IFundingProgramme;
243
+ envelope?: IFundingEnvelope | null;
244
+ invoice?: IFundingAllocationInvoice | null;
245
+ }
246
+ export interface IFundingAllocationInvoice {
247
+ id: string;
248
+ invoiceNumber: string;
249
+ grossEurCents: number;
250
+ }
251
+ export declare const FUNDING_ALLOCATION_INTERNAL_ATTRIBUTES: readonly ["billingAccountId", "envelopeId", "walletLedgerEntryId", "stripeInvoiceId"];
252
+ export type IFundingAllocationUser = Omit<IFundingAllocation, typeof FUNDING_ALLOCATION_INTERNAL_ATTRIBUTES[number] | 'programme' | 'envelope'>;
253
+ export interface IFundingProgrammeStatement {
254
+ grantedCents: number;
255
+ consumedCents: number;
256
+ planDiscountCents: number;
257
+ reclaimedCents: number;
258
+ adminDebitCents: number;
259
+ gainCents: number;
260
+ detailedSince: string | null;
261
+ }
262
+ export interface IFundingInvoiceCoverage {
263
+ programmeId: string;
264
+ sequenceNumber: number;
265
+ kind: FundingAllocationKind;
266
+ envelopeId: string | null;
267
+ amountCents: number;
268
+ }
269
+ export interface IFundingActionDetails {
270
+ [FundingActionKind.REVIEW_REQUEST]: {
271
+ entryPoint: FundingProgrammeEntryPoint;
272
+ };
273
+ [FundingActionKind.DECIDE_GRACE_ENDING]: {
274
+ criteria: FundingCriterionKey[];
275
+ };
276
+ [FundingActionKind.VERIFY_BEFORE_ACTIVATION]: Record<string, never>;
277
+ [FundingActionKind.OFFER_EXPIRING]: {
278
+ creditAmountCents: number;
279
+ };
280
+ [FundingActionKind.FOLLOW_UP_REMINDER]: {
281
+ sequenceNumber: number;
282
+ closedAt: string | null;
283
+ };
284
+ [FundingActionKind.TRANSITION_NOTICE]: {
285
+ count: number;
286
+ programmeIds: string[];
287
+ fromVersionIds: string[];
288
+ fromVersions: number[];
289
+ toVersionId: string;
290
+ toVersion: number;
291
+ templateId: string;
292
+ templateName: string;
293
+ variant: boolean;
294
+ };
295
+ [FundingActionKind.ANSWER_MESSAGE]: Record<string, never>;
296
+ }
297
+ export interface IFundingActionConditions {
298
+ templateName: string;
299
+ version: number;
300
+ variant: boolean;
301
+ }
302
+ export interface IFundingActionProgramme {
303
+ sequenceNumber: number;
304
+ status: FundingProgrammeStatus;
305
+ conditions: IFundingActionConditions | null;
306
+ }
307
+ export type IFundingAction = {
308
+ [K in FundingActionKind]: {
309
+ kind: K;
310
+ organizationId: string | null;
311
+ organizationName: string | null;
312
+ organizationSiren: string | null;
313
+ programmeId: string | null;
314
+ programme: IFundingActionProgramme | null;
315
+ dueAt: string | null;
316
+ detail: IFundingActionDetails[K];
317
+ };
318
+ }[FundingActionKind];
@@ -1,11 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FUNDING_PROGRAMME_EVENT_INTERNAL_ATTRIBUTES = exports.FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES = void 0;
3
+ exports.FUNDING_ALLOCATION_INTERNAL_ATTRIBUTES = exports.FUNDING_CONDITIONS_TRANSITION_INTERNAL_ATTRIBUTES = exports.FUNDING_CONDITIONS_VERSION_INTERNAL_ATTRIBUTES = exports.FUNDING_PROGRAMME_EVENT_INTERNAL_ATTRIBUTES = exports.FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES = void 0;
4
+ const enum_1 = require("../../enum");
4
5
  exports.FUNDING_PROGRAMME_INTERNAL_ATTRIBUTES = [
5
6
  'internalNote',
6
7
  'planGrantError',
7
8
  'stripeCouponId',
8
9
  'offerSentByAdminId',
10
+ 'followUpMode',
11
+ 'followUpDelayMonths',
12
+ 'followUpDueAt',
13
+ 'followUpTriggeredAt',
14
+ 'followUpProgrammeId',
9
15
  ];
10
16
  exports.FUNDING_PROGRAMME_EVENT_INTERNAL_ATTRIBUTES = ['actorId'];
17
+ exports.FUNDING_CONDITIONS_VERSION_INTERNAL_ATTRIBUTES = ['publishedByAdminId'];
18
+ exports.FUNDING_CONDITIONS_TRANSITION_INTERNAL_ATTRIBUTES = ['createdByAdminId'];
19
+ exports.FUNDING_ALLOCATION_INTERNAL_ATTRIBUTES = [
20
+ 'billingAccountId',
21
+ 'envelopeId',
22
+ 'walletLedgerEntryId',
23
+ 'stripeInvoiceId',
24
+ ];
11
25
  //# sourceMappingURL=funding.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"funding.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/funding.model.ts"],"names":[],"mappings":";;;AAuIa,QAAA,qCAAqC,GAAG;IACnD,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;CACZ,CAAC;AA8BE,QAAA,2CAA2C,GAAG,CAAC,SAAS,CAAU,CAAC"}
1
+ {"version":3,"file":"funding.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/funding.model.ts"],"names":[],"mappings":";;;AAAA,qCAeoB;AAsJP,QAAA,qCAAqC,GAAG;IACnD,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,qBAAqB;IACrB,eAAe;IACf,qBAAqB;IACrB,qBAAqB;CACb,CAAC;AA8BE,QAAA,2CAA2C,GAAG,CAAC,SAAS,CAAU,CAAC;AAwInE,QAAA,8CAA8C,GAAG,CAAC,oBAAoB,CAAU,CAAC;AA4DjF,QAAA,iDAAiD,GAAG,CAAC,kBAAkB,CAAU,CAAC;AAkFlF,QAAA,sCAAsC,GAAG;IACpD,kBAAkB;IAClB,YAAY;IACZ,qBAAqB;IACrB,iBAAiB;CACT,CAAC"}
@@ -10,7 +10,6 @@ export interface ISupportTicketAttachment {
10
10
  storageId: string;
11
11
  thumbnailId: string | null;
12
12
  thumbnailPublicAccessId: string | null;
13
- thumbnailPublicAccessPassword: string | null;
14
13
  supportTicketId: string;
15
14
  supportTicketMessageId: string | null;
16
15
  userId: string;
@@ -1,4 +1,4 @@
1
- import type { IInvoice } from '../types/interface';
1
+ import type { IInvoice, IInvoiceLine } from '../types/interface';
2
2
  export interface IInvoiceAmounts {
3
3
  grossEurCents: number;
4
4
  deductionsEurCents: number;
@@ -7,4 +7,5 @@ export interface IInvoiceAmounts {
7
7
  paidEurCents: number;
8
8
  remainingEurCents: number;
9
9
  }
10
+ export declare const computeInvoiceGrossEurCents: (lines: ReadonlyArray<Pick<IInvoiceLine, "type" | "amountEurCents">>) => number;
10
11
  export declare const computeInvoiceAmounts: (invoice: IInvoice) => IInvoiceAmounts;
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.computeInvoiceAmounts = void 0;
3
+ exports.computeInvoiceAmounts = exports.computeInvoiceGrossEurCents = void 0;
4
4
  const enum_1 = require("../types/enum");
5
+ const computeInvoiceGrossEurCents = (lines) => lines
6
+ .filter((line) => !enum_1.INVOICE_DEDUCTION_LINE_TYPES.includes(line.type))
7
+ .reduce((sum, line) => sum + line.amountEurCents, 0);
8
+ exports.computeInvoiceGrossEurCents = computeInvoiceGrossEurCents;
5
9
  const OWED_STATUSES = new Set([
6
10
  enum_1.InvoiceStatus.OPEN,
7
11
  enum_1.InvoiceStatus.UNCOLLECTIBLE,
8
12
  ]);
9
13
  const computeInvoiceAmounts = (invoice) => {
10
- let grossEurCents = 0;
11
- let deductionsEurCents = 0;
12
- for (const line of invoice.lines ?? []) {
13
- if (enum_1.INVOICE_DEDUCTION_LINE_TYPES.includes(line.type)) {
14
- deductionsEurCents -= line.amountEurCents;
15
- }
16
- else {
17
- grossEurCents += line.amountEurCents;
18
- }
19
- }
14
+ const lines = invoice.lines ?? [];
15
+ const grossEurCents = (0, exports.computeInvoiceGrossEurCents)(lines);
16
+ const deductionsEurCents = lines
17
+ .filter((line) => enum_1.INVOICE_DEDUCTION_LINE_TYPES.includes(line.type))
18
+ .reduce((sum, line) => sum - line.amountEurCents, 0);
20
19
  const applied = (invoice.commercialGestures ?? []).filter((gesture) => gesture.status === enum_1.CommercialGestureStatus.APPLIED);
21
20
  const gesturesEurCents = applied.reduce((sum, gesture) => sum + gesture.amountEurCents, 0);
22
21
  const reducedBeforePaymentEurCents = applied
@@ -1 +1 @@
1
- {"version":3,"file":"invoice-amounts.utils.js","sourceRoot":"","sources":["../../src/utils/invoice-amounts.utils.ts"],"names":[],"mappings":";;;AAAA,wCAKuB;AAuBvB,MAAM,aAAa,GAA+B,IAAI,GAAG,CAAC;IACxD,oBAAa,CAAC,IAAI;IAClB,oBAAa,CAAC,aAAa;CAC5B,CAAC,CAAC;AAoBI,MAAM,qBAAqB,GAAG,CAAC,OAAiB,EAAmB,EAAE;IAC1E,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,mCAA4B,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACrD,kBAAkB,IAAI,IAAI,CAAC,cAAc,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,aAAa,IAAI,IAAI,CAAC,cAAc,CAAC;QACvC,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,MAAM,CACvD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,8BAAuB,CAAC,OAAO,CAChE,CAAC;IACF,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAA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AM,YAAY,GAChB,OAAO,CAAC,MAAM,KAAK,oBAAa,CAAC,IAAI;QACnC,CAAC,CAAC,aAAa,GAAG,kBAAkB,GAAG,4BAA4B;QACnE,CAAC,CAAC,CAAC,CAAC;IACR,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3F,OAAO;QACL,aAAa;QACb,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;QACX,YAAY;QACZ,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,qBAAqB,yBA8BhC"}
@@ -41,6 +41,7 @@ exports.BILLING_SERVICE_NAMES = {
41
41
  [organization_billing_enum_1.BillingService.ABYSS_PLATFORM]: 'AbyssProject',
42
42
  [organization_billing_enum_1.BillingService.ABYSS_STORAGE]: 'AbyssStorage',
43
43
  [organization_billing_enum_1.BillingService.ABYSS_MONITOR]: 'AbyssMonitor',
44
+ [organization_billing_enum_1.BillingService.ABYSS_CONSOLE]: 'AbyssConsole',
44
45
  [organization_billing_enum_1.BillingService.ABYSS_CLOUD]: 'AbyssCloud',
45
46
  [organization_billing_enum_1.BillingService.ABYSS_CRYPT]: 'AbyssCrypt',
46
47
  [organization_billing_enum_1.BillingService.ABYSS_FORM]: 'AbyssForm',
@@ -1 +1 @@
1
- {"version":3,"file":"invoice-line-label.utils.js","sourceRoot":"","sources":["../../src/utils/invoice-line-label.utils.ts"],"names":[],"mappings":";;;AAAA,qGAAyF;AACzF,oFAAoF;AACpF,oEAAiE;AAEjE,uFAIiD;AACjD,yEAAgE;AAChE,+DAA6D;AAE7D,MAAM,YAAY,GAAiC;IACjD,CAAC,iCAAY,CAAC,MAAM,CAAC,EAAE,aAAa;IACpC,CAAC,iCAAY,CAAC,OAAO,CAAC,EAAE,SAAS;CAClC,CAAC;AASK,MAA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AAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,2CAAe,CAAC,YAAY,EAAE,CAAC;QACtD,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,IAAA,0CAAoB,EAAC,QAAQ,CAAC,EAAE;QACnE,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CACzB,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EACvC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CACtC,CAAC;IACF,OAAO,GAAG,KAAK,KAAK,MAAM,GAAG,CAAC;AAChC,CAAC,CAAC;AAhCW,QAAA,mBAAmB,uBAgC9B"}
@@ -197,4 +197,19 @@ describe('computeInvoiceAmounts', () => {
197
197
  });
198
198
  });
199
199
  });
200
+ describe('computeInvoiceGrossEurCents', () => {
201
+ it('sums the lines that are not a deduction, the gross computeInvoiceAmounts reads', () => {
202
+ const lines = [
203
+ line(index_1.InvoiceLineType.SUBSCRIPTION, 2900),
204
+ line(index_1.InvoiceLineType.OVERAGE, 4200),
205
+ line(index_1.InvoiceLineType.DISCOUNT_DEDUCTION, -2900),
206
+ line(index_1.InvoiceLineType.CREDITS_DEDUCTION, -1000),
207
+ ];
208
+ expect((0, index_1.computeInvoiceGrossEurCents)(lines)).toBe(7100);
209
+ expect((0, index_1.computeInvoiceGrossEurCents)(lines)).toBe((0, index_1.computeInvoiceAmounts)(invoice({ status: index_1.InvoiceStatus.OPEN, lines })).grossEurCents);
210
+ });
211
+ it('is 0 for an invoice without lines', () => {
212
+ expect((0, index_1.computeInvoiceGrossEurCents)([])).toBe(0);
213
+ });
214
+ });
200
215
  //# sourceMappingURL=invoice-amounts.utils.spec.js.map