@managemint-solutions/entities 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/enum/index.d.ts +1 -1
- package/dist/billing/enum/index.js +1 -1
- package/dist/billing/index.d.ts +2 -2
- package/dist/billing/index.js +1 -1
- package/dist/billing/invoices/index.d.ts +3 -3
- package/dist/billing/payments/index.d.ts +3 -3
- package/dist/configs/dto/index.d.ts +1 -1
- package/dist/configs/index.d.ts +1 -1
- package/dist/feature-requests/dto/index.d.ts +1 -1
- package/dist/feature-requests/enum/index.d.ts +1 -1
- package/dist/feature-requests/enum/index.js +1 -1
- package/dist/feature-requests/index.d.ts +2 -2
- package/dist/modules/index.d.ts +2 -2
- package/dist/modules/index.js +1 -1
- package/dist/organization/dto/index.d.ts +1 -1
- package/dist/organization/enum/index.d.ts +1 -1
- package/dist/organization/enum/index.js +1 -1
- package/dist/organization/index.d.ts +1 -1
- package/dist/paystack/enum/index.d.ts +2 -2
- package/dist/paystack/enum/index.js +2 -2
- package/dist/paystack/index.d.ts +1 -1
- package/dist/resend/webhook/index.d.ts +1 -1
- package/dist/support/dto/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ export declare enum BillingEventSource {
|
|
|
40
40
|
SCHEDULER = "scheduler"
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* Billing ledger event names
|
|
43
|
+
* Billing ledger event names - the values written to billing_events.event_type.
|
|
44
44
|
* Distinct from BillingStatus (which is the organization's current billing state)
|
|
45
45
|
* even though a couple of values coincide, e.g. cancellation_requested.
|
|
46
46
|
*/
|
|
@@ -53,7 +53,7 @@ var BillingEventSource;
|
|
|
53
53
|
})(BillingEventSource || (exports.BillingEventSource = BillingEventSource = {}));
|
|
54
54
|
;
|
|
55
55
|
/**
|
|
56
|
-
* Billing ledger event names
|
|
56
|
+
* Billing ledger event names - the values written to billing_events.event_type.
|
|
57
57
|
* Distinct from BillingStatus (which is the organization's current billing state)
|
|
58
58
|
* even though a couple of values coincide, e.g. cancellation_requested.
|
|
59
59
|
*/
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BillingEventSource, BillingEventType, BillingTransactionStatus, Billing
|
|
|
2
2
|
/**
|
|
3
3
|
* Day of the month every billing period is anchored on. The period containing a
|
|
4
4
|
* given date runs from the most recent 25th (inclusive) to the next 25th
|
|
5
|
-
* (exclusive)
|
|
5
|
+
* (exclusive) - the anchor day itself belongs to the new period.
|
|
6
6
|
*/
|
|
7
7
|
export declare const BILLING_ANCHOR_DAY = 25;
|
|
8
8
|
export type BillingPeriod = {
|
|
@@ -31,7 +31,7 @@ export type CreateTransactionInput = {
|
|
|
31
31
|
prorationEndAt?: Date | null;
|
|
32
32
|
/**
|
|
33
33
|
* Defaults to INITIALIZED. Pass PAID (with paidAt) for transactions recorded
|
|
34
|
-
* after the fact, e.g. subscription renewals reported by webhook
|
|
34
|
+
* after the fact, e.g. subscription renewals reported by webhook - inserting
|
|
35
35
|
* them directly as paid keeps them out of the one-open-transaction-per-
|
|
36
36
|
* organization unique index.
|
|
37
37
|
*/
|
package/dist/billing/index.js
CHANGED
|
@@ -4,6 +4,6 @@ exports.BILLING_ANCHOR_DAY = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* Day of the month every billing period is anchored on. The period containing a
|
|
6
6
|
* given date runs from the most recent 25th (inclusive) to the next 25th
|
|
7
|
-
* (exclusive)
|
|
7
|
+
* (exclusive) - the anchor day itself belongs to the new period.
|
|
8
8
|
*/
|
|
9
9
|
exports.BILLING_ANCHOR_DAY = 25;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BillingTransactionStatus, BillingTransactionType } from "../enum";
|
|
2
2
|
/** One priced line on an invoice document, frozen at issue time. */
|
|
3
3
|
export type InvoiceLineItem = {
|
|
4
|
-
/** The bold line: the module, e.g. "Core
|
|
4
|
+
/** The bold line: the module, e.g. "Core - subscription". */
|
|
5
5
|
label: string;
|
|
6
6
|
/** The grey sub-line: "12 seats · 2 Sep – 25 Sep 2026 (23 of 31 days)". */
|
|
7
7
|
detail?: string | null;
|
|
@@ -27,7 +27,7 @@ export type InvoiceSummary = {
|
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* The full invoice document data. `line_items` and `billed_to` are snapshots
|
|
30
|
-
* frozen when the invoice was written
|
|
30
|
+
* frozen when the invoice was written - the document must not change when the
|
|
31
31
|
* organization later edits its billing address or the pricebook moves on.
|
|
32
32
|
*/
|
|
33
33
|
export type InvoiceEntity = InvoiceSummary & {
|
|
@@ -44,7 +44,7 @@ export type InvoiceEntity = InvoiceSummary & {
|
|
|
44
44
|
registration_number: string | null;
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
/** Response of GET /billing/invoices/:invoiceId/html
|
|
47
|
+
/** Response of GET /billing/invoices/:invoiceId/html - the A4 document markup. */
|
|
48
48
|
export type InvoiceHtmlResponse = {
|
|
49
49
|
html: string;
|
|
50
50
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BillingTransactionStatus, BillingTransactionType } from "../enum";
|
|
2
2
|
/**
|
|
3
3
|
* One row of GET /billing/payments: a billing_transactions ledger row as the portal
|
|
4
|
-
* lists it. Every charge is a payment
|
|
5
|
-
* module charge, a reinstatement and a monthly renewal alike
|
|
4
|
+
* lists it. Every charge is a payment - the initial subscription, a pro-rata seat or
|
|
5
|
+
* module charge, a reinstatement and a monthly renewal alike - whether or not it
|
|
6
6
|
* settled. Invoices are the separate accounting documents that only renewals issue.
|
|
7
7
|
*/
|
|
8
8
|
export type PaymentSummary = {
|
|
@@ -26,6 +26,6 @@ export type PaymentEntity = PaymentSummary & {
|
|
|
26
26
|
proration_start_at: string | null;
|
|
27
27
|
proration_end_at: string | null;
|
|
28
28
|
paystack_reference: string | null;
|
|
29
|
-
/** The invoice this payment issued
|
|
29
|
+
/** The invoice this payment issued - renewals only; null for every other type. */
|
|
30
30
|
invoice_id: string | null;
|
|
31
31
|
};
|
|
@@ -4,7 +4,7 @@ export type CreateConfigDto = {
|
|
|
4
4
|
description?: string;
|
|
5
5
|
value?: ConfigValue;
|
|
6
6
|
};
|
|
7
|
-
/** `value` replaces the whole object
|
|
7
|
+
/** `value` replaces the whole object - it is not merged. `name` is the lookup key and is not editable here. */
|
|
8
8
|
export type UpdateConfigDto = {
|
|
9
9
|
description?: string;
|
|
10
10
|
value?: ConfigValue;
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
6
6
|
/** The `value` column: one JSON object keyed by setting name. */
|
|
7
7
|
export type ConfigValue = Record<string, JsonValue>;
|
|
8
8
|
/**
|
|
9
|
-
* One named config
|
|
9
|
+
* One named config - a row of `public.configs`. Global: there is no organization on the row.
|
|
10
10
|
* Every signed-in caller may read; only the service role writes. A feature-flag set is just a
|
|
11
11
|
* row someone named in Supabase Studio, not a concept the code knows about.
|
|
12
12
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The body of `POST /feature-requests`. Every field the endpoint accepts is here: the api's
|
|
3
3
|
* global ValidationPipe runs with `forbidNonWhitelisted`, so anything not on this contract is
|
|
4
|
-
* a 400
|
|
4
|
+
* a 400 - the honeypot included, which is why it is a declared field rather than a stray one.
|
|
5
5
|
*
|
|
6
6
|
* `source` is absent on purpose: the api sets it from `FeatureRequestSource`, never from the
|
|
7
7
|
* request.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where a feature request came in from. Stored as text and set server-side by the api
|
|
2
|
+
* Where a feature request came in from. Stored as text and set server-side by the api - the
|
|
3
3
|
* client never sends it, so a second intake (an in-portal "suggest a feature", say) adds a
|
|
4
4
|
* member here rather than trusting a request field.
|
|
5
5
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FeatureRequestSource = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Where a feature request came in from. Stored as text and set server-side by the api
|
|
5
|
+
* Where a feature request came in from. Stored as text and set server-side by the api - the
|
|
6
6
|
* client never sends it, so a second intake (an in-portal "suggest a feature", say) adds a
|
|
7
7
|
* member here rather than trusting a request field.
|
|
8
8
|
*/
|
|
@@ -6,7 +6,7 @@ export * from './enum';
|
|
|
6
6
|
*
|
|
7
7
|
* Deliberately tenant-less: the person filling the form has no account, so there is no
|
|
8
8
|
* `organization_id` and no `created_by` to record. The row is read in Supabase Studio and
|
|
9
|
-
* nowhere else
|
|
9
|
+
* nowhere else - nothing in the portal or on the website ever renders one back.
|
|
10
10
|
*/
|
|
11
11
|
export type FeatureRequestEntity = {
|
|
12
12
|
mms_id: UUID;
|
|
@@ -14,7 +14,7 @@ export type FeatureRequestEntity = {
|
|
|
14
14
|
name: string;
|
|
15
15
|
/** Markdown, as typed. Optional on the form, so an empty submission is stored as null. */
|
|
16
16
|
specification: string | null;
|
|
17
|
-
/** Whatever the requester called themselves
|
|
17
|
+
/** Whatever the requester called themselves - a person, a company, or both. */
|
|
18
18
|
requester_name: string;
|
|
19
19
|
requester_email: string;
|
|
20
20
|
source: FeatureRequestSource;
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Module keys the API gates features on. These MUST match billing_modules.module_key
|
|
3
|
-
* rows in the database
|
|
3
|
+
* rows in the database - the database decides which modules exist and what they cost;
|
|
4
4
|
* this only declares which of them unlock which features.
|
|
5
5
|
*
|
|
6
6
|
* Module selection is never validated against this: requests carry module ids, which
|
|
@@ -30,7 +30,7 @@ export type PricedModule = {
|
|
|
30
30
|
currency: string;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* A frozen price list version. Exactly one pricebook is active at a time
|
|
33
|
+
* A frozen price list version. Exactly one pricebook is active at a time - the
|
|
34
34
|
* one new organizations are pinned to and the one an organization moves to when
|
|
35
35
|
* it buys a module. Organizations on older pricebooks keep paying those prices
|
|
36
36
|
* until they change something (grandfathering).
|
package/dist/modules/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MODULE_KEYS = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Module keys the API gates features on. These MUST match billing_modules.module_key
|
|
6
|
-
* rows in the database
|
|
6
|
+
* rows in the database - the database decides which modules exist and what they cost;
|
|
7
7
|
* this only declares which of them unlock which features.
|
|
8
8
|
*
|
|
9
9
|
* Module selection is never validated against this: requests carry module ids, which
|
|
@@ -21,7 +21,7 @@ export type CreateOrganizationDto = {
|
|
|
21
21
|
org_billing_state?: string | null;
|
|
22
22
|
org_billing_postal_code?: string | null;
|
|
23
23
|
org_billing_country?: string | null;
|
|
24
|
-
/** Terms & conditions acceptance
|
|
24
|
+
/** Terms & conditions acceptance - the API refuses anything but `true`. */
|
|
25
25
|
org_consent_given: true;
|
|
26
26
|
org_industry?: string | null;
|
|
27
27
|
org_marketting_consent_given: boolean;
|
|
@@ -3,7 +3,7 @@ export declare enum OrganizationTypes {
|
|
|
3
3
|
SOLE_TRADER = "Sole-Trader"
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* How often an organization is billed. Only monthly billing exists today
|
|
6
|
+
* How often an organization is billed. Only monthly billing exists today - add
|
|
7
7
|
* members when the product supports more.
|
|
8
8
|
*/
|
|
9
9
|
export declare enum PaymentFrequency {
|
|
@@ -8,7 +8,7 @@ var OrganizationTypes;
|
|
|
8
8
|
})(OrganizationTypes || (exports.OrganizationTypes = OrganizationTypes = {}));
|
|
9
9
|
;
|
|
10
10
|
/**
|
|
11
|
-
* How often an organization is billed. Only monthly billing exists today
|
|
11
|
+
* How often an organization is billed. Only monthly billing exists today - add
|
|
12
12
|
* members when the product supports more.
|
|
13
13
|
*/
|
|
14
14
|
var PaymentFrequency;
|
|
@@ -39,7 +39,7 @@ export type OrganizationEntity = {
|
|
|
39
39
|
leave_calendar_start_month: number;
|
|
40
40
|
billing_cycle_locked: boolean;
|
|
41
41
|
/**
|
|
42
|
-
* The modules the organization subscribes to, priced at ITS pricebook's rates
|
|
42
|
+
* The modules the organization subscribes to, priced at ITS pricebook's rates -
|
|
43
43
|
* i.e. what it actually pays, which may be an older pricebook than the active one.
|
|
44
44
|
*/
|
|
45
45
|
modules: PricedModule[];
|
|
@@ -13,7 +13,7 @@ export declare enum PaystackWebhookEvent {
|
|
|
13
13
|
TRANSACTION_SUCCESSFUL = "charge.success"
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Paystack's own subscription vocabulary
|
|
16
|
+
* Paystack's own subscription vocabulary - an external contract we do not own, so
|
|
17
17
|
* this is not necessarily exhaustive. Provided for comparison sites only; the
|
|
18
18
|
* `status` fields on the payload interfaces deliberately stay `string`.
|
|
19
19
|
*/
|
|
@@ -25,7 +25,7 @@ export declare enum PaystackSubscriptionStatus {
|
|
|
25
25
|
CANCELLED = "cancelled"
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Paystack's own transaction vocabulary
|
|
28
|
+
* Paystack's own transaction vocabulary - an external contract we do not own, so
|
|
29
29
|
* this is not necessarily exhaustive. Provided for comparison sites only; the
|
|
30
30
|
* `status` fields on the payload interfaces deliberately stay `string`.
|
|
31
31
|
* Only SUCCESS means the charge completed and the money moved.
|
|
@@ -18,7 +18,7 @@ var PaystackWebhookEvent;
|
|
|
18
18
|
})(PaystackWebhookEvent || (exports.PaystackWebhookEvent = PaystackWebhookEvent = {}));
|
|
19
19
|
;
|
|
20
20
|
/**
|
|
21
|
-
* Paystack's own subscription vocabulary
|
|
21
|
+
* Paystack's own subscription vocabulary - an external contract we do not own, so
|
|
22
22
|
* this is not necessarily exhaustive. Provided for comparison sites only; the
|
|
23
23
|
* `status` fields on the payload interfaces deliberately stay `string`.
|
|
24
24
|
*/
|
|
@@ -32,7 +32,7 @@ var PaystackSubscriptionStatus;
|
|
|
32
32
|
})(PaystackSubscriptionStatus || (exports.PaystackSubscriptionStatus = PaystackSubscriptionStatus = {}));
|
|
33
33
|
;
|
|
34
34
|
/**
|
|
35
|
-
* Paystack's own transaction vocabulary
|
|
35
|
+
* Paystack's own transaction vocabulary - an external contract we do not own, so
|
|
36
36
|
* this is not necessarily exhaustive. Provided for comparison sites only; the
|
|
37
37
|
* `status` fields on the payload interfaces deliberately stay `string`.
|
|
38
38
|
* Only SUCCESS means the charge completed and the money moved.
|
package/dist/paystack/index.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ export type PaystackChargeAuthorizationResponse = {
|
|
|
143
143
|
/**
|
|
144
144
|
* A 2xx from Paystack only means the request was accepted. See
|
|
145
145
|
* PaystackTransactionStatus; only PaystackTransactionStatus.SUCCESS means the
|
|
146
|
-
* charge completed and the money moved
|
|
146
|
+
* charge completed and the money moved - the rest are failure, pending, or
|
|
147
147
|
* challenge states such as SEND_OTP when the authorization is not reusable.
|
|
148
148
|
*/
|
|
149
149
|
status: string;
|
|
@@ -28,7 +28,7 @@ export type ResendEmailEventData = {
|
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* One inbound email as `email.received` delivers it. The payload is metadata
|
|
31
|
-
* only
|
|
31
|
+
* only - body text and attachment bytes are fetched from the receiving API
|
|
32
32
|
* with `email_id`.
|
|
33
33
|
*/
|
|
34
34
|
export type ResendInboundEmailData = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { SupportTopic } from '../enum';
|
|
2
2
|
/**
|
|
3
3
|
* The body of `POST /support`. Every field the endpoint accepts is here: the api's global
|
|
4
|
-
* ValidationPipe runs with `forbidNonWhitelisted`, so anything not on this contract is a 400
|
|
4
|
+
* ValidationPipe runs with `forbidNonWhitelisted`, so anything not on this contract is a 400 -
|
|
5
5
|
* the honeypot included, which is why it is a declared field rather than a stray one.
|
|
6
6
|
*
|
|
7
|
-
* Nothing is stored. The api turns one of these into two emails
|
|
8
|
-
* inbox, and an acknowledgement back to `email`
|
|
7
|
+
* Nothing is stored. The api turns one of these into two emails - the message to the support
|
|
8
|
+
* inbox, and an acknowledgement back to `email` - and that is the whole record of it.
|
|
9
9
|
*/
|
|
10
10
|
export type CreateSupportRequestDto = {
|
|
11
11
|
topic: SupportTopic;
|
package/package.json
CHANGED