@managemint-solutions/entities 1.46.0 → 1.47.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.
@@ -146,3 +146,21 @@ export type DocumentPaymentIdDto = {
146
146
  documentId: string;
147
147
  paymentId: string;
148
148
  };
149
+ export type GetCatalogueTemplatesDto = {
150
+ /** Matches the title, description, category and tags. */
151
+ search?: string | null;
152
+ category?: string | null;
153
+ };
154
+ export type CatalogueTemplateSlugDto = {
155
+ slug: string;
156
+ };
157
+ /**
158
+ * Copies a catalogue template into the caller's organization as an ordinary template. `name` and
159
+ * `number_prefix`, when given, are what the copy is called and numbered under - checked like a
160
+ * template save (409 when another template has either); omitted, the copy takes the first free
161
+ * one (`CatalogueTemplateSuggestion`).
162
+ */
163
+ export type CopyCatalogueTemplateDto = CatalogueTemplateSlugDto & {
164
+ name?: string;
165
+ number_prefix?: string;
166
+ };
@@ -318,6 +318,13 @@ export type PublicDocumentPayment = {
318
318
  status: DocumentPayStatus;
319
319
  /** Prefills the payer's email; null when the document has no client email. */
320
320
  client_email: string | null;
321
+ /**
322
+ * What was paid (integer cents, every settled payment together) and when the first payment
323
+ * landed (an ISO date-time) - on a paid document, and on a void one paid before it was voided,
324
+ * whose refund its organization arranges. Both null when nothing has been paid.
325
+ */
326
+ paid_minor: number | null;
327
+ paid_at: string | null;
321
328
  };
322
329
  /** Where the payer goes next: Paystack's hosted checkout. */
323
330
  export type DocumentCheckout = {
@@ -387,4 +394,40 @@ export type DocumentValueChange = {
387
394
  old: DocumentVariableValue | null;
388
395
  new: DocumentVariableValue | null;
389
396
  };
397
+ /**
398
+ * One of the platform's starter templates, as the catalogue lists it (`GET /catalogue/templates`):
399
+ * public, the same for every organization, copied into one with `POST /document-templates/from-catalogue`.
400
+ */
401
+ export type CatalogueTemplateSummary = {
402
+ /** Its address: lower-case words joined by hyphens, e.g. `residential-lease-za`. */
403
+ slug: string;
404
+ title: string;
405
+ /** One or two plain sentences. */
406
+ description: string;
407
+ tags: string[];
408
+ /** The category the copy gets, e.g. Invoice, Contract, Letter. */
409
+ category: string;
410
+ };
411
+ /**
412
+ * The name and prefix a copy of a catalogue template would take in the caller's organization
413
+ * (`GET /catalogue/templates/:slug/suggestion`): the entry's own, or the first free "Invoice (2)"
414
+ * and "INV2-" when the organization already uses them.
415
+ */
416
+ export type CatalogueTemplateSuggestion = {
417
+ name: string;
418
+ number_prefix: string;
419
+ };
420
+ /** The whole entry (`GET /catalogue/templates/:slug`): what a copy is made of, and its preview's values. */
421
+ export type CatalogueTemplate = CatalogueTemplateSummary & {
422
+ /**
423
+ * What the copy is called and what its documents print as their title ("Tax Invoice"); the
424
+ * `title` is the catalogue's listing name.
425
+ */
426
+ name: string;
427
+ number_prefix: string;
428
+ variables: DocumentVariable[];
429
+ blocks: DocumentBlock[];
430
+ /** Filled in on the preview PDF only - never copied. */
431
+ sample_values: DocumentVariableValues;
432
+ };
390
433
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.46.0",
3
+ "version": "1.47.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": {