@managemint-solutions/sdk 0.66.0 → 0.67.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.
- package/dist/audit/index.d.ts +1 -1
- package/dist/audit/index.js +14 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +14 -0
- package/dist/documents/content.js +6 -1
- package/dist/documents/document-templates.js +12 -5
- package/dist/documents/documents.d.ts +7 -2
- package/dist/documents/documents.js +4 -0
- package/dist/documents/dto.d.ts +7 -2
- package/dist/documents/dto.js +21 -1
- package/dist/documents/render/html.d.ts +5 -0
- package/dist/documents/render/html.js +10 -3
- package/dist/documents/render/index.d.ts +1 -1
- package/dist/documents/render/index.js +2 -1
- package/dist/documents/render/values.d.ts +4 -1
- package/dist/documents/render/values.js +4 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +32 -3
- package/dist/inventory/dto.d.ts +134 -0
- package/dist/inventory/dto.js +684 -0
- package/dist/inventory/index.d.ts +7 -0
- package/dist/inventory/index.js +30 -0
- package/dist/inventory/items.d.ts +65 -0
- package/dist/inventory/items.js +216 -0
- package/dist/inventory/levels.d.ts +52 -0
- package/dist/inventory/levels.js +157 -0
- package/dist/inventory/locations.d.ts +29 -0
- package/dist/inventory/locations.js +158 -0
- package/dist/inventory/movements.d.ts +36 -0
- package/dist/inventory/movements.js +103 -0
- package/dist/inventory/stocktakes.d.ts +36 -0
- package/dist/inventory/stocktakes.js +70 -0
- package/dist/inventory/transfers.d.ts +73 -0
- package/dist/inventory/transfers.js +134 -0
- package/dist/organizations/dto.d.ts +3 -1
- package/dist/organizations/dto.js +12 -0
- package/dist/organizations/index.js +2 -0
- package/dist/permissions/dto.d.ts +4 -0
- package/dist/permissions/dto.js +20 -0
- package/dist/service-client/index.d.ts +6 -0
- package/dist/service-client/index.js +10 -0
- package/dist/users/paths.d.ts +5 -6
- package/dist/users/paths.js +12 -12
- package/package.json +2 -2
package/dist/audit/index.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export declare const diffChanges: (before: AuditRow, after: AuditRow, whole?: re
|
|
|
95
95
|
*/
|
|
96
96
|
export declare const snapshotChanges: (row: AuditRow, side: "new" | "old") => AuditChanges;
|
|
97
97
|
/** The tables a history's foreign-key values can be named from. */
|
|
98
|
-
export type AuditNameTable = 'users' | 'statuses' | 'clients' | 'projects' | 'tasks' | 'leave_types';
|
|
98
|
+
export type AuditNameTable = 'users' | 'statuses' | 'clients' | 'projects' | 'tasks' | 'leave_types' | 'inventory_items' | 'inventory_locations';
|
|
99
99
|
/**
|
|
100
100
|
* Runs `work` as one event: every audit entry recorded inside it - by any client or service
|
|
101
101
|
* scope - is held, then written once it settles (or throws, since its writes still happened)
|
package/dist/audit/index.js
CHANGED
|
@@ -160,6 +160,20 @@ const NAME_SOURCES = {
|
|
|
160
160
|
name: (row) => `TASK-${row.task_id} ${row.name}`,
|
|
161
161
|
},
|
|
162
162
|
leave_types: { from: 'leave_types', select: 'mms_id, name', search: ['name'], scoped: true, name: (row) => String(row.name) },
|
|
163
|
+
inventory_items: {
|
|
164
|
+
from: 'inventory_items',
|
|
165
|
+
select: 'mms_id, name, sku',
|
|
166
|
+
search: ['name', 'sku'],
|
|
167
|
+
scoped: true,
|
|
168
|
+
name: (row) => String(row.name),
|
|
169
|
+
},
|
|
170
|
+
inventory_locations: {
|
|
171
|
+
from: 'inventory_locations',
|
|
172
|
+
select: 'mms_id, name',
|
|
173
|
+
search: ['name'],
|
|
174
|
+
scoped: true,
|
|
175
|
+
name: (row) => String(row.name),
|
|
176
|
+
},
|
|
163
177
|
};
|
|
164
178
|
// How many matching names per table a history search widens itself by.
|
|
165
179
|
const SEARCH_NAME_LIMIT = 20;
|
package/dist/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { NotesResource } from './notes';
|
|
|
9
9
|
import { NotificationsResource } from './notifications';
|
|
10
10
|
import { BillingReadsResource } from './billing';
|
|
11
11
|
import { InvoicesReadsResource } from './billing/invoices';
|
|
12
|
+
import { InventoryItemsResource, InventoryLevelsResource, InventoryLocationsResource, InventoryMovementsResource, InventoryStocktakesResource, InventoryTransfersResource } from './inventory';
|
|
12
13
|
import { LabelsResource } from './labels';
|
|
13
14
|
import { LeadsResource } from './leads';
|
|
14
15
|
import { LeaveAdjustmentsResource, LeaveEntitlementsResource, LeaveRequestsResource, LeaveTypesResource } from './leave';
|
|
@@ -76,6 +77,12 @@ export declare class SupabaseClient {
|
|
|
76
77
|
readonly leaveRequests: LeaveRequestsResource;
|
|
77
78
|
readonly timesheets: TimesheetsResource;
|
|
78
79
|
readonly timesheetEntries: TimesheetEntriesResource;
|
|
80
|
+
readonly inventoryLocations: InventoryLocationsResource;
|
|
81
|
+
readonly inventoryItems: InventoryItemsResource;
|
|
82
|
+
readonly inventoryLevels: InventoryLevelsResource;
|
|
83
|
+
readonly inventoryMovements: InventoryMovementsResource;
|
|
84
|
+
readonly inventoryTransfers: InventoryTransfersResource;
|
|
85
|
+
readonly inventoryStocktakes: InventoryStocktakesResource;
|
|
79
86
|
constructor(config: SupabaseClientConfig);
|
|
80
87
|
}
|
|
81
88
|
export declare const createSupabaseClient: (config: SupabaseClientConfig) => SupabaseClient;
|
package/dist/client.js
CHANGED
|
@@ -11,6 +11,7 @@ const notes_1 = require("./notes");
|
|
|
11
11
|
const notifications_1 = require("./notifications");
|
|
12
12
|
const billing_1 = require("./billing");
|
|
13
13
|
const invoices_1 = require("./billing/invoices");
|
|
14
|
+
const inventory_1 = require("./inventory");
|
|
14
15
|
const labels_1 = require("./labels");
|
|
15
16
|
const leads_1 = require("./leads");
|
|
16
17
|
const leave_1 = require("./leave");
|
|
@@ -61,6 +62,13 @@ class SupabaseClient {
|
|
|
61
62
|
leaveRequests;
|
|
62
63
|
timesheets;
|
|
63
64
|
timesheetEntries;
|
|
65
|
+
// The inventory module: items, where they are kept, how many are there, the ledger, transfers, stocktakes.
|
|
66
|
+
inventoryLocations;
|
|
67
|
+
inventoryItems;
|
|
68
|
+
inventoryLevels;
|
|
69
|
+
inventoryMovements;
|
|
70
|
+
inventoryTransfers;
|
|
71
|
+
inventoryStocktakes;
|
|
64
72
|
constructor(config) {
|
|
65
73
|
this.auth = config.auth;
|
|
66
74
|
this.supabase =
|
|
@@ -95,6 +103,12 @@ class SupabaseClient {
|
|
|
95
103
|
this.leaveRequests = new leave_1.LeaveRequestsResource(this.supabase, this.auth, this.audit);
|
|
96
104
|
this.timesheets = new timesheets_1.TimesheetsResource(this.supabase, this.auth, this.audit);
|
|
97
105
|
this.timesheetEntries = new timesheets_1.TimesheetEntriesResource(this.supabase, this.auth, this.audit);
|
|
106
|
+
this.inventoryLocations = new inventory_1.InventoryLocationsResource(this.supabase, this.auth, this.audit);
|
|
107
|
+
this.inventoryItems = new inventory_1.InventoryItemsResource(this.supabase, this.auth, this.audit);
|
|
108
|
+
this.inventoryLevels = new inventory_1.InventoryLevelsResource(this.supabase, this.auth, this.audit);
|
|
109
|
+
this.inventoryMovements = new inventory_1.InventoryMovementsResource(this.supabase, this.auth, this.audit);
|
|
110
|
+
this.inventoryTransfers = new inventory_1.InventoryTransfersResource(this.supabase, this.auth, this.audit);
|
|
111
|
+
this.inventoryStocktakes = new inventory_1.InventoryStocktakesResource(this.supabase, this.auth, this.audit);
|
|
98
112
|
}
|
|
99
113
|
}
|
|
100
114
|
exports.SupabaseClient = SupabaseClient;
|
|
@@ -158,6 +158,11 @@ const entryProblem = (entry, properties, ...checks) => {
|
|
|
158
158
|
}
|
|
159
159
|
return null;
|
|
160
160
|
};
|
|
161
|
+
/** A line's stock item or location: left out, null, or a UUID. */
|
|
162
|
+
const idProblem = (value, what) => value === undefined || value === null || (typeof value === 'string' && UUID_PATTERN.test(value))
|
|
163
|
+
? null
|
|
164
|
+
: `${what} must be an id`;
|
|
165
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
161
166
|
const percentProblem = (value, what) => typeof value === 'number' && value >= 0 && value <= 100 ? null : `${what} must be a percentage from 0 to 100`;
|
|
162
167
|
/**
|
|
163
168
|
* A line's quantity or unit price: a number written in, or `{ variable }` naming a declared
|
|
@@ -334,7 +339,7 @@ const blocksProblem = (blocks, variables) => {
|
|
|
334
339
|
problem = listProblem(block.fields, 'fields', 'Field', MAX_FIELDS, (field) => entryProblem(field, ['label', 'value'], () => textProblem(field.label, 'Label', MAX_LABEL_LENGTH, known), () => textProblem(field.value, 'Value', MAX_TEXT_LENGTH, known)));
|
|
335
340
|
break;
|
|
336
341
|
case enum_1.DocumentBlockType.LINE_ITEMS:
|
|
337
|
-
problem = listProblem(block.items, 'lines', 'Line', MAX_LINES, (line) => entryProblem(line, ['description', 'quantity', 'unit_price_minor', 'discount_percent', 'tax_rate'], () => textProblem(line.description, 'Description', MAX_TEXT_LENGTH, known), () => amountProblem(line.quantity, 'Quantity', enum_1.DocumentVariableType.NUMBER, declared, {
|
|
342
|
+
problem = listProblem(block.items, 'lines', 'Line', MAX_LINES, (line) => entryProblem(line, ['description', 'quantity', 'unit_price_minor', 'discount_percent', 'tax_rate', 'item_id', 'location_id'], () => textProblem(line.description, 'Description', MAX_TEXT_LENGTH, known), () => idProblem(line.item_id, 'Item'), () => idProblem(line.location_id, 'Location'), () => amountProblem(line.quantity, 'Quantity', enum_1.DocumentVariableType.NUMBER, declared, {
|
|
338
343
|
holds: (amount) => Number.isFinite(amount) && amount > 0,
|
|
339
344
|
message: 'must be greater than 0',
|
|
340
345
|
}), () => amountProblem(line.unit_price_minor, 'Unit price', enum_1.DocumentVariableType.MONEY, declared, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentTemplatesResource = void 0;
|
|
4
|
-
const enum_1 = require("@managemint-solutions/entities/
|
|
4
|
+
const enum_1 = require("@managemint-solutions/entities/documents/enum");
|
|
5
|
+
const enum_2 = require("@managemint-solutions/entities/audit-trail/enum");
|
|
5
6
|
const audit_1 = require("../audit");
|
|
6
7
|
const errors_1 = require("../errors");
|
|
7
8
|
const tenancy_1 = require("../tenancy");
|
|
@@ -16,6 +17,8 @@ const TEMPLATE_LIST_SELECT = `
|
|
|
16
17
|
category,
|
|
17
18
|
number_prefix,
|
|
18
19
|
due_days,
|
|
20
|
+
stock_effect,
|
|
21
|
+
payable,
|
|
19
22
|
archived,
|
|
20
23
|
visibility
|
|
21
24
|
`;
|
|
@@ -29,6 +32,8 @@ const TEMPLATE_DETAIL_SELECT = `
|
|
|
29
32
|
category,
|
|
30
33
|
number_prefix,
|
|
31
34
|
due_days,
|
|
35
|
+
stock_effect,
|
|
36
|
+
payable,
|
|
32
37
|
variables,
|
|
33
38
|
blocks,
|
|
34
39
|
blocks_version,
|
|
@@ -46,6 +51,8 @@ const templateRow = (input) => ({
|
|
|
46
51
|
category: input.category ?? '',
|
|
47
52
|
number_prefix: input.number_prefix ?? '',
|
|
48
53
|
due_days: input.due_days ?? null,
|
|
54
|
+
stock_effect: input.stock_effect ?? enum_1.DocumentStockEffect.NONE,
|
|
55
|
+
payable: input.payable ?? true,
|
|
49
56
|
variables: input.variables,
|
|
50
57
|
blocks: input.blocks,
|
|
51
58
|
});
|
|
@@ -65,10 +72,10 @@ class DocumentTemplatesResource {
|
|
|
65
72
|
this.auth = auth;
|
|
66
73
|
this.table = (0, audit_1.auditedTable)(supabase, auth, audit, {
|
|
67
74
|
table: 'document_templates',
|
|
68
|
-
entityType:
|
|
75
|
+
entityType: enum_2.AuditTrailEntityType.DOCUMENT_TEMPLATES,
|
|
69
76
|
documentContent: true,
|
|
70
77
|
});
|
|
71
|
-
this.audit = new audit_1.EntityAuditTrail(supabase, auth,
|
|
78
|
+
this.audit = new audit_1.EntityAuditTrail(supabase, auth, enum_2.AuditTrailEntityType.DOCUMENT_TEMPLATES);
|
|
72
79
|
}
|
|
73
80
|
/** Newest first; `search` matches the name and the category. */
|
|
74
81
|
async list(query) {
|
|
@@ -126,12 +133,12 @@ class DocumentTemplatesResource {
|
|
|
126
133
|
return this.getById(templateId);
|
|
127
134
|
}
|
|
128
135
|
async archive(templateId) {
|
|
129
|
-
await this.table.transition(templateId,
|
|
136
|
+
await this.table.transition(templateId, enum_2.AuditTrailAction.ARCHIVE, (0, transforms_1.archivedPatch)(this.auth.mms_id));
|
|
130
137
|
return this.getById(templateId);
|
|
131
138
|
}
|
|
132
139
|
/** The table keeps no unarchive stamps, so the archive ones are cleared; the history keeps both. */
|
|
133
140
|
async unarchive(templateId) {
|
|
134
|
-
await this.table.transition(templateId,
|
|
141
|
+
await this.table.transition(templateId, enum_2.AuditTrailAction.UNARCHIVE, {
|
|
135
142
|
archived: false,
|
|
136
143
|
archived_at: null,
|
|
137
144
|
archived_by: null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MmsList } from '@managemint-solutions/entities/common';
|
|
2
2
|
import type { DocumentBlock, DocumentEmail, DocumentEntity, DocumentImageUploadTarget, DocumentSend, DocumentSummary, DocumentVariable, DocumentVariableValues } from '@managemint-solutions/entities/documents';
|
|
3
|
-
import { DocumentStatus, type DocumentRepeat, type DocumentVisibility } from '@managemint-solutions/entities/documents/enum';
|
|
3
|
+
import { DocumentStatus, DocumentStockEffect, type DocumentRepeat, type DocumentVisibility } from '@managemint-solutions/entities/documents/enum';
|
|
4
4
|
import { EntityAuditTrail, type AuditResource, type ResourceActor } from '../audit';
|
|
5
5
|
import type { TypedSupabaseClient } from '../client';
|
|
6
6
|
import type { GetDocumentsDto } from './dto';
|
|
@@ -32,6 +32,11 @@ type DocumentRow = {
|
|
|
32
32
|
voided_at: string | null;
|
|
33
33
|
voided_by: string | null;
|
|
34
34
|
void_reason: string | null;
|
|
35
|
+
/** Copied from the template at create; the stamp is written when the stock moves. */
|
|
36
|
+
stock_effect: DocumentStockEffect;
|
|
37
|
+
stock_moved_at: string | null;
|
|
38
|
+
/** Copied from the template at create: a client pays this. */
|
|
39
|
+
payable: boolean;
|
|
35
40
|
/** A recurring parent's schedule (dates YYYY-MM-DD), a scheduled draft's issue date and email. */
|
|
36
41
|
repeat: DocumentRepeat | null;
|
|
37
42
|
repeat_next_at: string | null;
|
|
@@ -60,7 +65,7 @@ export type DocumentSendEvent = Pick<DocumentSend, 'recipients' | 'cc' | 'subjec
|
|
|
60
65
|
* draft has none of. The schedule columns are optional (a plain draft has none); `repeat_from` is
|
|
61
66
|
* the cron's, for the drafts it makes.
|
|
62
67
|
*/
|
|
63
|
-
export type CreateDocumentRow = Omit<DocumentRow, 'status' | 'number_sequence' | 'number' | 'issued_at' | 'issued_by' | 'voided_at' | 'voided_by' | 'void_reason' | keyof DocumentScheduleRow> & Partial<DocumentScheduleRow>;
|
|
68
|
+
export type CreateDocumentRow = Omit<DocumentRow, 'status' | 'number_sequence' | 'number' | 'issued_at' | 'issued_by' | 'voided_at' | 'voided_by' | 'void_reason' | 'stock_moved_at' | keyof DocumentScheduleRow> & Partial<DocumentScheduleRow>;
|
|
64
69
|
type DocumentScheduleRow = Pick<DocumentRow, 'repeat' | 'repeat_next_at' | 'repeat_until' | 'repeat_paused' | 'repeat_from' | 'issue_at' | 'email' | 'due_days' | 'due_at'>;
|
|
65
70
|
/**
|
|
66
71
|
* A draft save, an issue or a void: whichever columns it changes - never the visibility, which
|
|
@@ -24,6 +24,7 @@ const DOCUMENT_LIST_SELECT = `
|
|
|
24
24
|
client:clients!documents_client_fkey ( mms_id, name ),
|
|
25
25
|
currency,
|
|
26
26
|
total_minor,
|
|
27
|
+
payable,
|
|
27
28
|
issued_at,
|
|
28
29
|
repeat,
|
|
29
30
|
repeat_next_at,
|
|
@@ -62,6 +63,9 @@ const DOCUMENT_DETAIL_SELECT = `
|
|
|
62
63
|
voided_at,
|
|
63
64
|
voided_by:user_profiles!voided_by ${transforms_1.USER_PROFILE_EMBED},
|
|
64
65
|
void_reason,
|
|
66
|
+
stock_effect,
|
|
67
|
+
stock_moved_at,
|
|
68
|
+
payable,
|
|
65
69
|
repeat,
|
|
66
70
|
repeat_next_at,
|
|
67
71
|
repeat_until,
|
package/dist/documents/dto.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocumentBlock, DocumentEmail, DocumentVariable, DocumentVariableValues } from '@managemint-solutions/entities/documents';
|
|
2
|
-
import type { CatalogueTemplateSlugDto as CatalogueTemplateSlugDtoType, CopyCatalogueTemplateDto as CopyCatalogueTemplateDtoType, CreateDocumentDto as CreateDocumentDtoType, CreateDocumentTemplateDto as CreateDocumentTemplateDtoType, DocumentIdDto as DocumentIdDtoType, DocumentImageNameDto as DocumentImageNameDtoType, DocumentImageUrlsDto as DocumentImageUrlsDtoType, DocumentPayQueryDto as DocumentPayQueryDtoType, DocumentPayTokenDto as DocumentPayTokenDtoType, DocumentPaymentIdDto as DocumentPaymentIdDtoType, DocumentTemplateIdDto as DocumentTemplateIdDtoType, GetCatalogueTemplatesDto as GetCatalogueTemplatesDtoType, GetDocumentsDto as GetDocumentsDtoType, GetDocumentTemplatesDto as GetDocumentTemplatesDtoType, PayDocumentDto as PayDocumentDtoType, RecordDocumentPaymentDto as RecordDocumentPaymentDtoType, ReassignPrivateDocumentsDto as ReassignPrivateDocumentsDtoType, SendDocumentDto as SendDocumentDtoType, UpdateDocumentDto as UpdateDocumentDtoType, UpdateDocumentTemplateDto as UpdateDocumentTemplateDtoType, VoidDocumentDto as VoidDocumentDtoType } from '@managemint-solutions/entities/documents/dto';
|
|
3
|
-
import { DocumentPaymentFilter, DocumentRepeat, DocumentStatus, DocumentVisibility } from '@managemint-solutions/entities/documents/enum';
|
|
2
|
+
import type { CatalogueTemplateSlugDto as CatalogueTemplateSlugDtoType, CopyCatalogueTemplateDto as CopyCatalogueTemplateDtoType, CreateDocumentDto as CreateDocumentDtoType, CreateDocumentTemplateDto as CreateDocumentTemplateDtoType, DocumentIdDto as DocumentIdDtoType, DocumentImageNameDto as DocumentImageNameDtoType, DocumentImageUrlsDto as DocumentImageUrlsDtoType, DocumentPayQueryDto as DocumentPayQueryDtoType, DocumentPayTokenDto as DocumentPayTokenDtoType, DocumentPaymentIdDto as DocumentPaymentIdDtoType, DocumentTemplateIdDto as DocumentTemplateIdDtoType, GetCatalogueTemplatesDto as GetCatalogueTemplatesDtoType, GetDocumentsDto as GetDocumentsDtoType, GetDocumentTemplatesDto as GetDocumentTemplatesDtoType, PayDocumentDto as PayDocumentDtoType, RecordDocumentPaymentDto as RecordDocumentPaymentDtoType, ReassignPrivateDocumentsDto as ReassignPrivateDocumentsDtoType, SendDocumentDto as SendDocumentDtoType, UpdateDocumentDto as UpdateDocumentDtoType, UpdateDocumentTemplateDto as UpdateDocumentTemplateDtoType, ConvertDocumentDto as ConvertDocumentDtoType, VoidDocumentDto as VoidDocumentDtoType } from '@managemint-solutions/entities/documents/dto';
|
|
3
|
+
import { DocumentPaymentFilter, DocumentRepeat, DocumentStatus, DocumentStockEffect, DocumentVisibility } from '@managemint-solutions/entities/documents/enum';
|
|
4
4
|
export declare class GetDocumentTemplatesDto implements GetDocumentTemplatesDtoType {
|
|
5
5
|
readonly search?: string | null;
|
|
6
6
|
readonly category?: string | null;
|
|
@@ -17,6 +17,8 @@ export declare class UpdateDocumentTemplateDto implements UpdateDocumentTemplate
|
|
|
17
17
|
readonly category?: string;
|
|
18
18
|
readonly number_prefix?: string;
|
|
19
19
|
readonly due_days?: number | null;
|
|
20
|
+
readonly stock_effect?: DocumentStockEffect;
|
|
21
|
+
readonly payable?: boolean;
|
|
20
22
|
readonly variables: DocumentVariable[];
|
|
21
23
|
readonly blocks: DocumentBlock[];
|
|
22
24
|
}
|
|
@@ -79,6 +81,9 @@ export declare class UpdateDocumentDto extends DocumentScheduleDto implements Up
|
|
|
79
81
|
readonly variable_values: DocumentVariableValues;
|
|
80
82
|
readonly blocks: DocumentBlock[];
|
|
81
83
|
}
|
|
84
|
+
export declare class ConvertDocumentDto implements ConvertDocumentDtoType {
|
|
85
|
+
readonly template_id: string;
|
|
86
|
+
}
|
|
82
87
|
export declare class VoidDocumentDto implements VoidDocumentDtoType {
|
|
83
88
|
readonly reason: string;
|
|
84
89
|
}
|
package/dist/documents/dto.js
CHANGED
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CopyCatalogueTemplateDto = exports.CatalogueTemplateSlugDto = exports.GetCatalogueTemplatesDto = exports.DocumentPaymentIdDto = exports.RecordDocumentPaymentDto = exports.PayDocumentDto = exports.DocumentPayQueryDto = exports.DocumentPayTokenDto = exports.SendDocumentDto = exports.ReassignPrivateDocumentsDto = exports.DocumentImageUrlsDto = exports.DocumentImageNameDto = exports.VoidDocumentDto = exports.UpdateDocumentDto = exports.CreateDocumentDto = exports.DocumentIdDto = exports.GetDocumentsDto = exports.CreateDocumentTemplateDto = exports.UpdateDocumentTemplateDto = exports.DocumentTemplateIdDto = exports.GetDocumentTemplatesDto = void 0;
|
|
12
|
+
exports.CopyCatalogueTemplateDto = exports.CatalogueTemplateSlugDto = exports.GetCatalogueTemplatesDto = exports.DocumentPaymentIdDto = exports.RecordDocumentPaymentDto = exports.PayDocumentDto = exports.DocumentPayQueryDto = exports.DocumentPayTokenDto = exports.SendDocumentDto = exports.ReassignPrivateDocumentsDto = exports.DocumentImageUrlsDto = exports.DocumentImageNameDto = exports.VoidDocumentDto = exports.ConvertDocumentDto = exports.UpdateDocumentDto = exports.CreateDocumentDto = exports.DocumentIdDto = exports.GetDocumentsDto = exports.CreateDocumentTemplateDto = exports.UpdateDocumentTemplateDto = exports.DocumentTemplateIdDto = exports.GetDocumentTemplatesDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const enum_1 = require("@managemint-solutions/entities/documents/enum");
|
|
@@ -89,6 +89,8 @@ class UpdateDocumentTemplateDto {
|
|
|
89
89
|
category;
|
|
90
90
|
number_prefix;
|
|
91
91
|
due_days;
|
|
92
|
+
stock_effect;
|
|
93
|
+
payable;
|
|
92
94
|
variables;
|
|
93
95
|
blocks;
|
|
94
96
|
}
|
|
@@ -117,6 +119,16 @@ __decorate([
|
|
|
117
119
|
IsDueDays(),
|
|
118
120
|
__metadata("design:type", Object)
|
|
119
121
|
], UpdateDocumentTemplateDto.prototype, "due_days", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
124
|
+
(0, class_validator_1.IsEnum)(enum_1.DocumentStockEffect, { message: 'Stock effect must be none, issue or receive' }),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], UpdateDocumentTemplateDto.prototype, "stock_effect", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, class_validator_1.IsOptional)(),
|
|
129
|
+
(0, class_validator_1.IsBoolean)({ message: 'Payable must be true or false' }),
|
|
130
|
+
__metadata("design:type", Boolean)
|
|
131
|
+
], UpdateDocumentTemplateDto.prototype, "payable", void 0);
|
|
120
132
|
__decorate([
|
|
121
133
|
(0, content_1.IsDocumentVariables)(),
|
|
122
134
|
__metadata("design:type", Array)
|
|
@@ -412,6 +424,14 @@ __decorate([
|
|
|
412
424
|
(0, content_1.IsDocumentBlocks)(),
|
|
413
425
|
__metadata("design:type", Array)
|
|
414
426
|
], UpdateDocumentDto.prototype, "blocks", void 0);
|
|
427
|
+
class ConvertDocumentDto {
|
|
428
|
+
template_id;
|
|
429
|
+
}
|
|
430
|
+
exports.ConvertDocumentDto = ConvertDocumentDto;
|
|
431
|
+
__decorate([
|
|
432
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Pick the invoice template to make it from' }),
|
|
433
|
+
__metadata("design:type", String)
|
|
434
|
+
], ConvertDocumentDto.prototype, "template_id", void 0);
|
|
415
435
|
class VoidDocumentDto {
|
|
416
436
|
reason;
|
|
417
437
|
}
|
|
@@ -3,6 +3,11 @@ import { DocumentStatus } from '@managemint-solutions/entities/documents/enum';
|
|
|
3
3
|
/** What is printed: a document, or a template (saved, or unsaved in the builder). */
|
|
4
4
|
export type PrintableDocument = {
|
|
5
5
|
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* The template's word for what this is ("Invoice", "Quote"): the printed heading when given,
|
|
8
|
+
* with the title under it. Null or '' prints the title as the heading (a blank document).
|
|
9
|
+
*/
|
|
10
|
+
category?: string | null;
|
|
6
11
|
number: string | null;
|
|
7
12
|
/** Null for a template. */
|
|
8
13
|
status: DocumentStatus | null;
|
|
@@ -286,8 +286,13 @@ exports.renderBand = renderBand;
|
|
|
286
286
|
*/
|
|
287
287
|
const renderDocument = (document, imageUrls) => {
|
|
288
288
|
const ctx = contextOf(document);
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
// The heading is what the document is (30 Oct 2026: a client read "Block A board 1 - materials"
|
|
290
|
+
// where "Invoice" belonged); the title, when it adds something, sits under it. Issued prints no
|
|
291
|
+
// stamp: a draft or a void says so, an issued document is simply the document.
|
|
292
|
+
const category = (document.category ?? '').trim();
|
|
293
|
+
const title = (0, values_1.escapeHtml)(category || document.title || 'Document');
|
|
294
|
+
const subtitle = category && document.title && document.title.trim() !== category ? (0, values_1.escapeHtml)(document.title) : '';
|
|
295
|
+
const status = document.status === enum_1.DocumentStatus.ISSUED ? '' : document.status ? STATUS_LABELS[document.status] : 'Template';
|
|
291
296
|
const statusColour = document.status === enum_1.DocumentStatus.ISSUED ? '#1d6b4a'
|
|
292
297
|
: document.status === enum_1.DocumentStatus.VOID ? '#b3261e'
|
|
293
298
|
: '#6b6960';
|
|
@@ -321,6 +326,7 @@ const renderDocument = (document, imageUrls) => {
|
|
|
321
326
|
.doc-number { font-family: ${values_1.MONO_FONT}; font-size: 10.5pt; color: #5f5d56; margin-top: 8px; }
|
|
322
327
|
.doc-date { font-size: 10pt; color: #5f5d56; margin-top: 4px; }
|
|
323
328
|
.doc-status { font-size: 11pt; font-weight: 700; letter-spacing: 0.3px; color: ${statusColour}; margin-top: 10px; }
|
|
329
|
+
.doc-subtitle { font-size: 11pt; color: #6b6960; margin-top: 4px; }
|
|
324
330
|
|
|
325
331
|
.block { margin-top: 18px; }
|
|
326
332
|
.text p { margin: 0 0 8px; }
|
|
@@ -390,10 +396,11 @@ const renderDocument = (document, imageUrls) => {
|
|
|
390
396
|
</div>
|
|
391
397
|
<div class="doc">
|
|
392
398
|
<div class="doc-title">${title}</div>
|
|
399
|
+
${subtitle ? `<div class="doc-subtitle">${subtitle}</div>` : ''}
|
|
393
400
|
<!-- The number line is kept on drafts too, so issuing never reflows the pages. -->
|
|
394
401
|
<div class="doc-number">${document.number ? (0, values_1.escapeHtml)(document.number) : ' '}</div>
|
|
395
402
|
<div class="doc-date">${valueHtml(enum_1.DocumentSystemVariable.ISSUE_DATE, ctx)}</div>
|
|
396
|
-
<div class="doc-status">${status}</div>
|
|
403
|
+
<div class="doc-status">${status || ' '}</div>
|
|
397
404
|
</div>
|
|
398
405
|
</div>
|
|
399
406
|
${document.blocks.map((block) => blockHtml(block, ctx, imageUrls)).join('')}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DOCUMENT_PAGE_MARGINS, fillText, renderBand, renderDocument, type DocumentBand, type PrintableDocument, type RenderedDocument, } from './html';
|
|
2
|
-
export { documentTotals, dueDateFrom, escapeHtml, formatDocumentDate, johannesburgDate, money, MONO_FONT, printsMoney, startingValues, SYSTEM_VARIABLES, systemValues, type DocumentTotals, type SystemValueInputs, } from './values';
|
|
2
|
+
export { amountOf, documentTotals, dueDateFrom, escapeHtml, formatDocumentDate, johannesburgDate, money, MONO_FONT, printsMoney, startingValues, SYSTEM_VARIABLES, systemValues, type DocumentTotals, type SystemValueInputs, } from './values';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.systemValues = exports.SYSTEM_VARIABLES = exports.startingValues = exports.printsMoney = exports.MONO_FONT = exports.money = exports.johannesburgDate = exports.formatDocumentDate = exports.escapeHtml = exports.dueDateFrom = exports.documentTotals = exports.renderDocument = exports.renderBand = exports.fillText = exports.DOCUMENT_PAGE_MARGINS = void 0;
|
|
3
|
+
exports.systemValues = exports.SYSTEM_VARIABLES = exports.startingValues = exports.printsMoney = exports.MONO_FONT = exports.money = exports.johannesburgDate = exports.formatDocumentDate = exports.escapeHtml = exports.dueDateFrom = exports.documentTotals = exports.amountOf = exports.renderDocument = exports.renderBand = exports.fillText = exports.DOCUMENT_PAGE_MARGINS = void 0;
|
|
4
4
|
// `@managemint-solutions/sdk/documents`: the document renderer and the values it prints, as pure
|
|
5
5
|
// functions with no dependency beyond the shared entities - no Node, no Nest, no supabase-js, no
|
|
6
6
|
// DOM - so the api's PDF and the portal's in-browser preview are one renderer. The caller loads
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "fillText", { enumerable: true, get: function ()
|
|
|
11
11
|
Object.defineProperty(exports, "renderBand", { enumerable: true, get: function () { return html_1.renderBand; } });
|
|
12
12
|
Object.defineProperty(exports, "renderDocument", { enumerable: true, get: function () { return html_1.renderDocument; } });
|
|
13
13
|
var values_1 = require("./values");
|
|
14
|
+
Object.defineProperty(exports, "amountOf", { enumerable: true, get: function () { return values_1.amountOf; } });
|
|
14
15
|
Object.defineProperty(exports, "documentTotals", { enumerable: true, get: function () { return values_1.documentTotals; } });
|
|
15
16
|
Object.defineProperty(exports, "dueDateFrom", { enumerable: true, get: function () { return values_1.dueDateFrom; } });
|
|
16
17
|
Object.defineProperty(exports, "escapeHtml", { enumerable: true, get: function () { return values_1.escapeHtml; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentBlock, DocumentLineItem, DocumentVariable, DocumentVariableValues } from '@managemint-solutions/entities/documents';
|
|
1
|
+
import type { DocumentBlock, DocumentLineAmount, DocumentLineItem, DocumentVariable, DocumentVariableValues } from '@managemint-solutions/entities/documents';
|
|
2
2
|
import { DocumentSystemVariable } from '@managemint-solutions/entities/documents/enum';
|
|
3
3
|
/**
|
|
4
4
|
* A variable in plain text (field values, table cells, line descriptions, signer labels, header
|
|
@@ -32,6 +32,9 @@ export type DocumentTotals = {
|
|
|
32
32
|
tax_minor: number;
|
|
33
33
|
total_minor: number;
|
|
34
34
|
};
|
|
35
|
+
/** A line's quantity or unit price: the number written in, or its variable's value (0 while it has none). */
|
|
36
|
+
/** A line's quantity or price as a figure: written in, or read from its variable (0 when unset). */
|
|
37
|
+
export declare const amountOf: (amount: DocumentLineAmount, values: DocumentVariableValues) => number;
|
|
35
38
|
/**
|
|
36
39
|
* One line's amounts in cents: gross = quantity x unit price, the discount a percentage of the
|
|
37
40
|
* gross, net = gross - discount, the tax a percentage of the net - each rounded to the cent.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.systemValues = exports.dueDateFrom = exports.johannesburgDate = exports.startingValues = exports.printsMoney = exports.documentTotals = exports.lineAmounts = exports.MONO_FONT = exports.formatDocumentDate = exports.money = exports.escapeHtml = exports.safeHref = exports.isObject = exports.SYSTEM_VARIABLES = exports.DOCUMENT_VARIABLE_PATTERN = void 0;
|
|
3
|
+
exports.systemValues = exports.dueDateFrom = exports.johannesburgDate = exports.startingValues = exports.printsMoney = exports.documentTotals = exports.lineAmounts = exports.amountOf = exports.MONO_FONT = exports.formatDocumentDate = exports.money = exports.escapeHtml = exports.safeHref = exports.isObject = exports.SYSTEM_VARIABLES = exports.DOCUMENT_VARIABLE_PATTERN = void 0;
|
|
4
4
|
const enum_1 = require("@managemint-solutions/entities/documents/enum");
|
|
5
5
|
// The values a document prints that nobody types in: one line's amounts, the totals of every line
|
|
6
6
|
// items block, the system values, and how a value is escaped and formatted. Pure functions with
|
|
@@ -61,18 +61,20 @@ exports.formatDocumentDate = formatDocumentDate;
|
|
|
61
61
|
/** The monospace stack for numbers - the design's JetBrains Mono, self-contained. */
|
|
62
62
|
exports.MONO_FONT = 'ui-monospace, \'Cascadia Mono\', \'Segoe UI Mono\', Consolas, monospace';
|
|
63
63
|
/** A line's quantity or unit price: the number written in, or its variable's value (0 while it has none). */
|
|
64
|
+
/** A line's quantity or price as a figure: written in, or read from its variable (0 when unset). */
|
|
64
65
|
const amountOf = (amount, values) => {
|
|
65
66
|
if (typeof amount === 'number')
|
|
66
67
|
return amount;
|
|
67
68
|
const value = values[amount.variable];
|
|
68
69
|
return typeof value === 'number' ? value : 0;
|
|
69
70
|
};
|
|
71
|
+
exports.amountOf = amountOf;
|
|
70
72
|
/**
|
|
71
73
|
* One line's amounts in cents: gross = quantity x unit price, the discount a percentage of the
|
|
72
74
|
* gross, net = gross - discount, the tax a percentage of the net - each rounded to the cent.
|
|
73
75
|
*/
|
|
74
76
|
const lineAmounts = (line, values) => {
|
|
75
|
-
const gross = Math.round(amountOf(line.quantity, values) * amountOf(line.unit_price_minor, values));
|
|
77
|
+
const gross = Math.round((0, exports.amountOf)(line.quantity, values) * (0, exports.amountOf)(line.unit_price_minor, values));
|
|
76
78
|
const discount = Math.round((gross * line.discount_percent) / 100);
|
|
77
79
|
const net = gross - discount;
|
|
78
80
|
const tax = Math.round((net * line.tax_rate) / 100);
|
package/dist/index.d.ts
CHANGED
|
@@ -41,9 +41,11 @@ export type { ClaimOutcome, WebhookEventRow, WebhookEventsTable } from './webhoo
|
|
|
41
41
|
export { GetSupportingFilesDto, SupportingFileIdDto, SupportingFileNamesDto } from './supporting-files';
|
|
42
42
|
export { ClientIdDto, CreateClientDto, GetClientsDto, StaffGetClientsDto, UpdateClientDto } from './clients';
|
|
43
43
|
export { ConvertLeadDto, CreateLeadDto, GetLeadsDto, LeadIdDto, StaffGetLeadsDto, UpdateLeadDto } from './leads';
|
|
44
|
+
export type { CreateInventoryMovementRow, InventoryItemRow, InventoryLevelRow, InventoryStocktakeRow, InventoryTransferRow, UpdateInventoryTransferRow, } from './inventory';
|
|
45
|
+
export { CountInventoryDto, CountInventoryLineDto, CreateInventoryItemDto, CreateInventoryLocationDto, CreateInventoryMovementDto, CreateInventoryTransferDto, CreateInventoryTransferLineDto, GeocodeAddressDto, GetInventoryItemsDto, GetInventoryLocationsDto, GetInventoryMovementsDto, GetInventoryStocktakesDto, GetInventoryTransfersDto, ImportInventoryItemDto, ImportInventoryItemsDto, InventoryItemIdDto, InventoryLevelKeyDto, InventoryLocationIdDto, InventoryStocktakeIdDto, InventoryTransferIdDto, ReceiveInventoryTransferDto, StaffGetInventoryItemsDto, SuggestAddressesDto, UpdateInventoryItemDto, UpdateInventoryLevelDto, UpdateInventoryLocationDto, UpdateInventoryTransferDto, } from './inventory';
|
|
44
46
|
export type { CreateDocumentRow, DocumentListRecord, DocumentSendEvent, UpdateDocumentRow } from './documents';
|
|
45
47
|
export type { CreatePaymentRow, OpenPaymentRecord, PaymentRecord, SettlePaymentRow } from './payments';
|
|
46
|
-
export { CatalogueTemplateSlugDto, CopyCatalogueTemplateDto, CreateDocumentDto, CreateDocumentTemplateDto, DocumentIdDto, DocumentImageNameDto, DocumentImageUrlsDto, DocumentPayQueryDto, DocumentPayTokenDto, DocumentPaymentIdDto, DocumentTemplateIdDto, documentProblem, GetCatalogueTemplatesDto, GetDocumentsDto, GetDocumentTemplatesDto, PayDocumentDto, RecordDocumentPaymentDto, SendDocumentDto, UpdateDocumentDto, UpdateDocumentTemplateDto, VoidDocumentDto, ReassignPrivateDocumentsDto, } from './documents';
|
|
48
|
+
export { CatalogueTemplateSlugDto, CopyCatalogueTemplateDto, CreateDocumentDto, CreateDocumentTemplateDto, DocumentIdDto, DocumentImageNameDto, DocumentImageUrlsDto, DocumentPayQueryDto, DocumentPayTokenDto, DocumentPaymentIdDto, DocumentTemplateIdDto, documentProblem, GetCatalogueTemplatesDto, GetDocumentsDto, GetDocumentTemplatesDto, PayDocumentDto, RecordDocumentPaymentDto, SendDocumentDto, UpdateDocumentDto, UpdateDocumentTemplateDto, VoidDocumentDto, ConvertDocumentDto, ReassignPrivateDocumentsDto, } from './documents';
|
|
47
49
|
export type { DocumentRecord, DocumentTemplateRecord } from './documents';
|
|
48
50
|
export type { VisibilityRecord, VisibilityShareInput } from './visibility';
|
|
49
51
|
export { UpdateVisibilityDto } from './visibility';
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
// to keep. The row and input types they produce and accept are exported for annotations.
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.UpdateOrganizationPayoutsDto = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.UpdateLabelDto = exports.LabelIdDto = exports.GetLabelsDto = exports.AddLabelDto = exports.UpdateStatusDto = exports.StatusIdDto = exports.ReorderStatusesDto = exports.GetStatusesDto = exports.AddStatusDto = exports.CreateSupportRequestDto = exports.UpdateConfigDto = exports.CreateConfigDto = exports.CreateFeatureRequestDto = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.PaymentIdDto = exports.InitialPaymentDto = exports.GetPaymentsQueryDto = exports.CancelSubscriptionDto = exports.withAuditBatch = exports.GetAuditTrailDto = exports.IsNullable = exports.EmptyToNull = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.createSupabaseStaffClient = exports.SupabaseStaffClient = exports.createSupabaseClient = exports.SupabaseClient = void 0;
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.monthlyTotalMinor = exports.weekStartOf = exports.minutesBetween = void 0;
|
|
11
|
+
exports.InventoryLocationIdDto = exports.InventoryLevelKeyDto = exports.InventoryItemIdDto = exports.ImportInventoryItemsDto = exports.ImportInventoryItemDto = exports.GetInventoryTransfersDto = exports.GetInventoryStocktakesDto = exports.GetInventoryMovementsDto = exports.GetInventoryLocationsDto = exports.GetInventoryItemsDto = exports.GeocodeAddressDto = exports.CreateInventoryTransferLineDto = exports.CreateInventoryTransferDto = exports.CreateInventoryMovementDto = exports.CreateInventoryLocationDto = exports.CreateInventoryItemDto = exports.CountInventoryLineDto = exports.CountInventoryDto = exports.UpdateLeadDto = exports.StaffGetLeadsDto = exports.LeadIdDto = exports.GetLeadsDto = exports.CreateLeadDto = exports.ConvertLeadDto = exports.UpdateClientDto = exports.StaffGetClientsDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = exports.SupportingFileNamesDto = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.StaffGetUsersDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UserApiCredentialIdDto = exports.MintEmulationTokenDto = exports.CreateUserApiCredentialDto = exports.UpdateStaffPermissionsDto = exports.StaffIdDto = exports.CreateStaffDto = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.OrganizationIdDto = exports.GetOrganizationsDto = exports.CreateOrganizationDto = void 0;
|
|
12
|
+
exports.CreateLeaveTypeDto = exports.CreateLeaveRequestDto = exports.CreateLeaveEntitlementDto = exports.CreateLeaveAdjustmentDto = exports.BulkCreateLeaveEntitlementsDto = exports.UpdateTaskDto = exports.TaskLinkIdDto = exports.TaskIdDto = exports.StaffGetTasksDto = exports.GetTasksDto = exports.CreateTaskDto = exports.AddTaskLinkDto = exports.UpdateProjectDto = exports.StaffGetProjectsDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.UpdateVisibilityDto = exports.ReassignPrivateDocumentsDto = exports.ConvertDocumentDto = exports.VoidDocumentDto = exports.UpdateDocumentTemplateDto = exports.UpdateDocumentDto = exports.SendDocumentDto = exports.RecordDocumentPaymentDto = exports.PayDocumentDto = exports.GetDocumentTemplatesDto = exports.GetDocumentsDto = exports.GetCatalogueTemplatesDto = exports.documentProblem = exports.DocumentTemplateIdDto = exports.DocumentPaymentIdDto = exports.DocumentPayTokenDto = exports.DocumentPayQueryDto = exports.DocumentImageUrlsDto = exports.DocumentImageNameDto = exports.DocumentIdDto = exports.CreateDocumentTemplateDto = exports.CreateDocumentDto = exports.CopyCatalogueTemplateDto = exports.CatalogueTemplateSlugDto = exports.UpdateInventoryTransferDto = exports.UpdateInventoryLocationDto = exports.UpdateInventoryLevelDto = exports.UpdateInventoryItemDto = exports.SuggestAddressesDto = exports.StaffGetInventoryItemsDto = exports.ReceiveInventoryTransferDto = exports.InventoryTransferIdDto = exports.InventoryStocktakeIdDto = void 0;
|
|
13
|
+
exports.monthlyTotalMinor = exports.weekStartOf = exports.minutesBetween = exports.UpdateTimesheetEntryDto = exports.TimesheetIdDto = exports.TimesheetEntryIdDto = exports.ReviewTimesheetDto = exports.GetTimesheetsDto = exports.GetTimesheetReportDto = exports.CreateTimesheetEntryDto = exports.todayInJohannesburg = exports.shiftDays = exports.proRataDays = exports.isWithinPeriod = exports.initialUntil = exports.cyclePeriodFor = exports.countWorkingDays = exports.completedMonths = exports.addMonths = exports.GetPublicHolidaysDto = exports.UpdateLeaveTypeDto = exports.UpdateLeaveRequestDto = exports.UpdateLeaveEntitlementDto = exports.ReviewLeaveRequestDto = exports.LeaveTypeIdDto = exports.LeaveRequestIdDto = exports.LeaveEntitlementIdDto = exports.GetLeaveTypesDto = exports.GetLeaveRequestsDto = exports.GetLeaveEntitlementsDto = exports.GetLeaveCalendarDto = void 0;
|
|
14
14
|
var client_1 = require("./client");
|
|
15
15
|
Object.defineProperty(exports, "SupabaseClient", { enumerable: true, get: function () { return client_1.SupabaseClient; } });
|
|
16
16
|
Object.defineProperty(exports, "createSupabaseClient", { enumerable: true, get: function () { return client_1.createSupabaseClient; } });
|
|
@@ -123,6 +123,34 @@ Object.defineProperty(exports, "GetLeadsDto", { enumerable: true, get: function
|
|
|
123
123
|
Object.defineProperty(exports, "LeadIdDto", { enumerable: true, get: function () { return leads_1.LeadIdDto; } });
|
|
124
124
|
Object.defineProperty(exports, "StaffGetLeadsDto", { enumerable: true, get: function () { return leads_1.StaffGetLeadsDto; } });
|
|
125
125
|
Object.defineProperty(exports, "UpdateLeadDto", { enumerable: true, get: function () { return leads_1.UpdateLeadDto; } });
|
|
126
|
+
var inventory_1 = require("./inventory");
|
|
127
|
+
Object.defineProperty(exports, "CountInventoryDto", { enumerable: true, get: function () { return inventory_1.CountInventoryDto; } });
|
|
128
|
+
Object.defineProperty(exports, "CountInventoryLineDto", { enumerable: true, get: function () { return inventory_1.CountInventoryLineDto; } });
|
|
129
|
+
Object.defineProperty(exports, "CreateInventoryItemDto", { enumerable: true, get: function () { return inventory_1.CreateInventoryItemDto; } });
|
|
130
|
+
Object.defineProperty(exports, "CreateInventoryLocationDto", { enumerable: true, get: function () { return inventory_1.CreateInventoryLocationDto; } });
|
|
131
|
+
Object.defineProperty(exports, "CreateInventoryMovementDto", { enumerable: true, get: function () { return inventory_1.CreateInventoryMovementDto; } });
|
|
132
|
+
Object.defineProperty(exports, "CreateInventoryTransferDto", { enumerable: true, get: function () { return inventory_1.CreateInventoryTransferDto; } });
|
|
133
|
+
Object.defineProperty(exports, "CreateInventoryTransferLineDto", { enumerable: true, get: function () { return inventory_1.CreateInventoryTransferLineDto; } });
|
|
134
|
+
Object.defineProperty(exports, "GeocodeAddressDto", { enumerable: true, get: function () { return inventory_1.GeocodeAddressDto; } });
|
|
135
|
+
Object.defineProperty(exports, "GetInventoryItemsDto", { enumerable: true, get: function () { return inventory_1.GetInventoryItemsDto; } });
|
|
136
|
+
Object.defineProperty(exports, "GetInventoryLocationsDto", { enumerable: true, get: function () { return inventory_1.GetInventoryLocationsDto; } });
|
|
137
|
+
Object.defineProperty(exports, "GetInventoryMovementsDto", { enumerable: true, get: function () { return inventory_1.GetInventoryMovementsDto; } });
|
|
138
|
+
Object.defineProperty(exports, "GetInventoryStocktakesDto", { enumerable: true, get: function () { return inventory_1.GetInventoryStocktakesDto; } });
|
|
139
|
+
Object.defineProperty(exports, "GetInventoryTransfersDto", { enumerable: true, get: function () { return inventory_1.GetInventoryTransfersDto; } });
|
|
140
|
+
Object.defineProperty(exports, "ImportInventoryItemDto", { enumerable: true, get: function () { return inventory_1.ImportInventoryItemDto; } });
|
|
141
|
+
Object.defineProperty(exports, "ImportInventoryItemsDto", { enumerable: true, get: function () { return inventory_1.ImportInventoryItemsDto; } });
|
|
142
|
+
Object.defineProperty(exports, "InventoryItemIdDto", { enumerable: true, get: function () { return inventory_1.InventoryItemIdDto; } });
|
|
143
|
+
Object.defineProperty(exports, "InventoryLevelKeyDto", { enumerable: true, get: function () { return inventory_1.InventoryLevelKeyDto; } });
|
|
144
|
+
Object.defineProperty(exports, "InventoryLocationIdDto", { enumerable: true, get: function () { return inventory_1.InventoryLocationIdDto; } });
|
|
145
|
+
Object.defineProperty(exports, "InventoryStocktakeIdDto", { enumerable: true, get: function () { return inventory_1.InventoryStocktakeIdDto; } });
|
|
146
|
+
Object.defineProperty(exports, "InventoryTransferIdDto", { enumerable: true, get: function () { return inventory_1.InventoryTransferIdDto; } });
|
|
147
|
+
Object.defineProperty(exports, "ReceiveInventoryTransferDto", { enumerable: true, get: function () { return inventory_1.ReceiveInventoryTransferDto; } });
|
|
148
|
+
Object.defineProperty(exports, "StaffGetInventoryItemsDto", { enumerable: true, get: function () { return inventory_1.StaffGetInventoryItemsDto; } });
|
|
149
|
+
Object.defineProperty(exports, "SuggestAddressesDto", { enumerable: true, get: function () { return inventory_1.SuggestAddressesDto; } });
|
|
150
|
+
Object.defineProperty(exports, "UpdateInventoryItemDto", { enumerable: true, get: function () { return inventory_1.UpdateInventoryItemDto; } });
|
|
151
|
+
Object.defineProperty(exports, "UpdateInventoryLevelDto", { enumerable: true, get: function () { return inventory_1.UpdateInventoryLevelDto; } });
|
|
152
|
+
Object.defineProperty(exports, "UpdateInventoryLocationDto", { enumerable: true, get: function () { return inventory_1.UpdateInventoryLocationDto; } });
|
|
153
|
+
Object.defineProperty(exports, "UpdateInventoryTransferDto", { enumerable: true, get: function () { return inventory_1.UpdateInventoryTransferDto; } });
|
|
126
154
|
var documents_1 = require("./documents");
|
|
127
155
|
Object.defineProperty(exports, "CatalogueTemplateSlugDto", { enumerable: true, get: function () { return documents_1.CatalogueTemplateSlugDto; } });
|
|
128
156
|
Object.defineProperty(exports, "CopyCatalogueTemplateDto", { enumerable: true, get: function () { return documents_1.CopyCatalogueTemplateDto; } });
|
|
@@ -145,6 +173,7 @@ Object.defineProperty(exports, "SendDocumentDto", { enumerable: true, get: funct
|
|
|
145
173
|
Object.defineProperty(exports, "UpdateDocumentDto", { enumerable: true, get: function () { return documents_1.UpdateDocumentDto; } });
|
|
146
174
|
Object.defineProperty(exports, "UpdateDocumentTemplateDto", { enumerable: true, get: function () { return documents_1.UpdateDocumentTemplateDto; } });
|
|
147
175
|
Object.defineProperty(exports, "VoidDocumentDto", { enumerable: true, get: function () { return documents_1.VoidDocumentDto; } });
|
|
176
|
+
Object.defineProperty(exports, "ConvertDocumentDto", { enumerable: true, get: function () { return documents_1.ConvertDocumentDto; } });
|
|
148
177
|
Object.defineProperty(exports, "ReassignPrivateDocumentsDto", { enumerable: true, get: function () { return documents_1.ReassignPrivateDocumentsDto; } });
|
|
149
178
|
var visibility_1 = require("./visibility");
|
|
150
179
|
Object.defineProperty(exports, "UpdateVisibilityDto", { enumerable: true, get: function () { return visibility_1.UpdateVisibilityDto; } });
|