@managemint-solutions/entities 1.11.0 → 1.13.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.
@@ -9,7 +9,10 @@ export type InvoiceLineItem = {
9
9
  quantity: number;
10
10
  amount_minor: number;
11
11
  };
12
- /** One row of GET /billing/invoices. */
12
+ /**
13
+ * One row of GET /billing/invoices. An invoice is the accounting document a monthly
14
+ * renewal issues; every other charge is a payment only (see ../payments).
15
+ */
13
16
  export type InvoiceSummary = {
14
17
  mms_id: string;
15
18
  /** Sequential per organization; displayed as INV-000123. */
@@ -0,0 +1,11 @@
1
+ export type GetPaymentsDto = {
2
+ page: number;
3
+ page_size: number;
4
+ /** Comma-joined BillingTransactionStatus values on the wire. Absent = all payments. */
5
+ status_in?: string | null;
6
+ /** Comma-joined BillingTransactionType values on the wire. Absent = all payments. */
7
+ type_in?: string | null;
8
+ };
9
+ export type PaymentIdDto = {
10
+ paymentId: string;
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { BillingTransactionStatus, BillingTransactionType } from "../enum";
2
+ /**
3
+ * One row of GET /billing/payments: a billing_transactions ledger row as the portal
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
+ * settled. Invoices are the separate accounting documents that only renewals issue.
7
+ */
8
+ export type PaymentSummary = {
9
+ mms_id: string;
10
+ created_at: string;
11
+ transaction_type: BillingTransactionType;
12
+ transaction_status: BillingTransactionStatus;
13
+ amount_minor: number;
14
+ currency: string;
15
+ paid_at: string | null;
16
+ failure_reason: string | null;
17
+ };
18
+ /** The full payment record behind GET /billing/payments/:paymentId. */
19
+ export type PaymentEntity = PaymentSummary & {
20
+ updated_at: string | null;
21
+ active_seat_count: number;
22
+ paid_seat_count: number;
23
+ modules: string[];
24
+ /** The per-seat prices the charge was priced from, keyed by module key. */
25
+ module_price_snapshot: Record<string, number> | null;
26
+ proration_start_at: string | null;
27
+ proration_end_at: string | null;
28
+ paystack_reference: string | null;
29
+ /** The invoice this payment issued — renewals only; null for every other type. */
30
+ invoice_id: string | null;
31
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The body of `POST /feature-requests`. Every field the endpoint accepts is here: the api's
3
+ * global ValidationPipe runs with `forbidNonWhitelisted`, so anything not on this contract is
4
+ * a 400 — the honeypot included, which is why it is a declared field rather than a stray one.
5
+ *
6
+ * `source` is absent on purpose: the api sets it from `FeatureRequestSource`, never from the
7
+ * request.
8
+ */
9
+ export type CreateFeatureRequestDto = {
10
+ name: string;
11
+ /** Markdown. Empty is normalised to null before it is stored. */
12
+ specification?: string | null;
13
+ requester_name: string;
14
+ requester_email: string;
15
+ /**
16
+ * Honeypot. The website renders it off-screen and always submits it empty; a bot that fills
17
+ * every input it can see gets a 201 and no stored row. Optional so an older client that does
18
+ * not send it at all still works.
19
+ */
20
+ website_url?: string;
21
+ };
22
+ /** All a submitter gets back: the id of the row, or a throwaway one when the honeypot tripped. */
23
+ export type CreateFeatureRequestResponse = {
24
+ mms_id: string;
25
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Where a feature request came in from. Stored as text and set server-side by the api — the
3
+ * client never sends it, so a second intake (an in-portal "suggest a feature", say) adds a
4
+ * member here rather than trusting a request field.
5
+ */
6
+ export declare enum FeatureRequestSource {
7
+ WEBSITE = "website"
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeatureRequestSource = void 0;
4
+ /**
5
+ * Where a feature request came in from. Stored as text and set server-side by the api — the
6
+ * client never sends it, so a second intake (an in-portal "suggest a feature", say) adds a
7
+ * member here rather than trusting a request field.
8
+ */
9
+ var FeatureRequestSource;
10
+ (function (FeatureRequestSource) {
11
+ FeatureRequestSource["WEBSITE"] = "website";
12
+ })(FeatureRequestSource || (exports.FeatureRequestSource = FeatureRequestSource = {}));
13
+ ;
@@ -0,0 +1,21 @@
1
+ import type { UUID } from 'crypto';
2
+ import { FeatureRequestSource } from './enum';
3
+ export * from './enum';
4
+ /**
5
+ * A "I need something" submission from the marketing website's roadmap page.
6
+ *
7
+ * Deliberately tenant-less: the person filling the form has no account, so there is no
8
+ * `organization_id` and no `created_by` to record. The row is read in Supabase Studio and
9
+ * nowhere else — nothing in the portal or on the website ever renders one back.
10
+ */
11
+ export type FeatureRequestEntity = {
12
+ mms_id: UUID;
13
+ created_at: string;
14
+ name: string;
15
+ /** Markdown, as typed. Optional on the form, so an empty submission is stored as null. */
16
+ specification: string | null;
17
+ /** Whatever the requester called themselves — a person, a company, or both. */
18
+ requester_name: string;
19
+ requester_email: string;
20
+ source: FeatureRequestSource;
21
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enum"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {