types-salon-management 1.0.30 → 1.0.32
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/api/company-profile.d.ts +26 -0
- package/dist/api/company-profile.d.ts.map +1 -0
- package/dist/api/company-profile.js +3 -0
- package/dist/api/company-profile.js.map +1 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/invoices/index.d.ts +4 -0
- package/dist/api/invoices/index.d.ts.map +1 -0
- package/dist/api/invoices/index.js +20 -0
- package/dist/api/invoices/index.js.map +1 -0
- package/dist/api/invoices/invoice.constants.d.ts +19 -0
- package/dist/api/invoices/invoice.constants.d.ts.map +1 -0
- package/dist/api/invoices/invoice.constants.js +19 -0
- package/dist/api/invoices/invoice.constants.js.map +1 -0
- package/dist/api/invoices/invoice.dto.d.ts +83 -0
- package/dist/api/invoices/invoice.dto.d.ts.map +1 -0
- package/dist/api/invoices/invoice.dto.js +3 -0
- package/dist/api/invoices/invoice.dto.js.map +1 -0
- package/dist/api/invoices/invoice.requests.d.ts +73 -0
- package/dist/api/invoices/invoice.requests.d.ts.map +1 -0
- package/dist/api/invoices/invoice.requests.js +3 -0
- package/dist/api/invoices/invoice.requests.js.map +1 -0
- package/dist/api/session.d.ts +1 -0
- package/dist/api/session.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/company-profile.ts +28 -0
- package/src/api/index.ts +2 -0
- package/src/api/invoices/index.ts +3 -0
- package/src/api/invoices/invoice.constants.ts +24 -0
- package/src/api/invoices/invoice.dto.ts +87 -0
- package/src/api/invoices/invoice.requests.ts +86 -0
- package/src/api/session.ts +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LocationAddressDto } from './location/location.dto';
|
|
2
|
+
import type { TimeFrameDto } from './master';
|
|
3
|
+
export interface CompanySocialMediaLinksDto {
|
|
4
|
+
instagram: string | null;
|
|
5
|
+
facebook: string | null;
|
|
6
|
+
youtube: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface CompanyProfileDto {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | null;
|
|
11
|
+
logoUrl: string | null;
|
|
12
|
+
address: LocationAddressDto | null;
|
|
13
|
+
socialMediaLinks: CompanySocialMediaLinksDto;
|
|
14
|
+
giftCardExpiry: TimeFrameDto;
|
|
15
|
+
taxCalculationMethod: 'inclusive' | 'exclusive';
|
|
16
|
+
}
|
|
17
|
+
export interface UpdateCompanyProfileRequest {
|
|
18
|
+
name?: string;
|
|
19
|
+
description?: string | null;
|
|
20
|
+
logoUrl?: string | null;
|
|
21
|
+
address?: LocationAddressDto | null;
|
|
22
|
+
socialMediaLinks?: Partial<CompanySocialMediaLinksDto>;
|
|
23
|
+
giftCardExpiry?: TimeFrameDto;
|
|
24
|
+
taxCalculationMethod?: 'inclusive' | 'exclusive';
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=company-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-profile.d.ts","sourceRoot":"","sources":["../../src/api/company-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnC,gBAAgB,EAAE,0BAA0B,CAAC;IAC7C,cAAc,EAAE,YAAY,CAAC;IAC7B,oBAAoB,EAAE,WAAW,GAAG,WAAW,CAAC;CACjD;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,oBAAoB,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-profile.js","sourceRoot":"","sources":["../../src/api/company-profile.ts"],"names":[],"mappings":""}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './location';
|
|
|
12
12
|
export * from './platform-terms';
|
|
13
13
|
export * from './user/index';
|
|
14
14
|
export * from './company-settings/index';
|
|
15
|
+
export * from './company-profile';
|
|
15
16
|
export * from './staff/index';
|
|
16
17
|
export * from './resources/index';
|
|
17
18
|
export * from './contraindications/index';
|
|
@@ -21,4 +22,5 @@ export * from './user-roles/index';
|
|
|
21
22
|
export * from './permissions/index';
|
|
22
23
|
export * from './payment-methods/index';
|
|
23
24
|
export * from './clients/index';
|
|
25
|
+
export * from './invoices/index';
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./location"), exports);
|
|
|
28
28
|
__exportStar(require("./platform-terms"), exports);
|
|
29
29
|
__exportStar(require("./user/index"), exports);
|
|
30
30
|
__exportStar(require("./company-settings/index"), exports);
|
|
31
|
+
__exportStar(require("./company-profile"), exports);
|
|
31
32
|
__exportStar(require("./staff/index"), exports);
|
|
32
33
|
__exportStar(require("./resources/index"), exports);
|
|
33
34
|
__exportStar(require("./contraindications/index"), exports);
|
|
@@ -37,4 +38,5 @@ __exportStar(require("./user-roles/index"), exports);
|
|
|
37
38
|
__exportStar(require("./permissions/index"), exports);
|
|
38
39
|
__exportStar(require("./payment-methods/index"), exports);
|
|
39
40
|
__exportStar(require("./clients/index"), exports);
|
|
41
|
+
__exportStar(require("./invoices/index"), exports);
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,gDAA8B;AAC9B,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,gDAA8B;AAC9B,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/invoices/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./invoice.constants"), exports);
|
|
18
|
+
__exportStar(require("./invoice.dto"), exports);
|
|
19
|
+
__exportStar(require("./invoice.requests"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/invoices/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,gDAA8B;AAC9B,qDAAmC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Postgres invoice status (Phase 1: paid only). Distinct from legacy Firestore InvoiceStatus enum. */
|
|
2
|
+
export declare const PostgresInvoiceStatus: {
|
|
3
|
+
readonly PAID: "paid";
|
|
4
|
+
};
|
|
5
|
+
export type PostgresInvoiceStatus = (typeof PostgresInvoiceStatus)[keyof typeof PostgresInvoiceStatus];
|
|
6
|
+
export declare const InvoiceClientType: {
|
|
7
|
+
readonly WALK_IN: "walk_in";
|
|
8
|
+
readonly RECORDED: "recorded";
|
|
9
|
+
};
|
|
10
|
+
export type InvoiceClientType = (typeof InvoiceClientType)[keyof typeof InvoiceClientType];
|
|
11
|
+
export declare const InvoiceItemType: {
|
|
12
|
+
readonly SERVICE: "service";
|
|
13
|
+
readonly PRODUCT: "product";
|
|
14
|
+
readonly GIFT_CARD: "gift_card";
|
|
15
|
+
readonly PACKAGE: "package";
|
|
16
|
+
readonly APPOINTMENT: "appointment";
|
|
17
|
+
};
|
|
18
|
+
export type InvoiceItemType = (typeof InvoiceItemType)[keyof typeof InvoiceItemType];
|
|
19
|
+
//# sourceMappingURL=invoice.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.constants.d.ts","sourceRoot":"","sources":["../../../src/api/invoices/invoice.constants.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,eAAO,MAAM,qBAAqB;;CAExB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAErE,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE3F,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceItemType = exports.InvoiceClientType = exports.PostgresInvoiceStatus = void 0;
|
|
4
|
+
/** Postgres invoice status (Phase 1: paid only). Distinct from legacy Firestore InvoiceStatus enum. */
|
|
5
|
+
exports.PostgresInvoiceStatus = {
|
|
6
|
+
PAID: 'paid',
|
|
7
|
+
};
|
|
8
|
+
exports.InvoiceClientType = {
|
|
9
|
+
WALK_IN: 'walk_in',
|
|
10
|
+
RECORDED: 'recorded',
|
|
11
|
+
};
|
|
12
|
+
exports.InvoiceItemType = {
|
|
13
|
+
SERVICE: 'service',
|
|
14
|
+
PRODUCT: 'product',
|
|
15
|
+
GIFT_CARD: 'gift_card',
|
|
16
|
+
PACKAGE: 'package',
|
|
17
|
+
APPOINTMENT: 'appointment',
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=invoice.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.constants.js","sourceRoot":"","sources":["../../../src/api/invoices/invoice.constants.ts"],"names":[],"mappings":";;;AAAA,uGAAuG;AAC1F,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,MAAM;CACJ,CAAC;AAKE,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIE,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CAClB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { InvoiceClientType, InvoiceItemType, PostgresInvoiceStatus } from './invoice.constants';
|
|
4
|
+
export interface TaxDetailDto {
|
|
5
|
+
taxId: string | null;
|
|
6
|
+
taxName: string;
|
|
7
|
+
taxRate: string;
|
|
8
|
+
taxAmount: string;
|
|
9
|
+
}
|
|
10
|
+
export interface InvoiceSummaryDto {
|
|
11
|
+
id: string;
|
|
12
|
+
invoiceNumber: string;
|
|
13
|
+
financialYear: string;
|
|
14
|
+
invoiceSerial: number;
|
|
15
|
+
status: PostgresInvoiceStatus;
|
|
16
|
+
clientType: InvoiceClientType;
|
|
17
|
+
clientId: string | null;
|
|
18
|
+
clientDisplayName: string | null;
|
|
19
|
+
locationId: string;
|
|
20
|
+
outletName: string;
|
|
21
|
+
subtotal: string;
|
|
22
|
+
discountTotal: string;
|
|
23
|
+
taxTotal: string;
|
|
24
|
+
total: string;
|
|
25
|
+
invoiceDate: string;
|
|
26
|
+
finalizedAt: string;
|
|
27
|
+
receivedByStaffName: string;
|
|
28
|
+
}
|
|
29
|
+
export interface InvoiceItemDto {
|
|
30
|
+
id: string;
|
|
31
|
+
itemType: InvoiceItemType;
|
|
32
|
+
serviceId: string;
|
|
33
|
+
serviceVariantId: string;
|
|
34
|
+
staffId: string;
|
|
35
|
+
staffId2: string | null;
|
|
36
|
+
itemName: string;
|
|
37
|
+
staffName: string;
|
|
38
|
+
staffName2: string | null;
|
|
39
|
+
quantity: string;
|
|
40
|
+
sortOrder: number;
|
|
41
|
+
durationMinutes: number | null;
|
|
42
|
+
unitPrice: string;
|
|
43
|
+
lineSubtotal: string;
|
|
44
|
+
lineDiscountType: DiscountType | null;
|
|
45
|
+
lineDiscountValue: string | null;
|
|
46
|
+
lineDiscountAmount: string;
|
|
47
|
+
cartDiscountAmount: string;
|
|
48
|
+
lineNet: string;
|
|
49
|
+
taxAmount: string;
|
|
50
|
+
lineTotal: string;
|
|
51
|
+
taxDetails: TaxDetailDto[];
|
|
52
|
+
}
|
|
53
|
+
export interface InvoicePaymentLineDto {
|
|
54
|
+
id: string;
|
|
55
|
+
paymentMethodId: string;
|
|
56
|
+
paymentMethodName: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
tenderedAmount: string | null;
|
|
59
|
+
changeAmount: string | null;
|
|
60
|
+
paidAt: string;
|
|
61
|
+
}
|
|
62
|
+
export interface InvoiceDetailDto extends InvoiceSummaryDto {
|
|
63
|
+
clientPhone: PhoneNumberModel | null;
|
|
64
|
+
clientPhoneE164: string | null;
|
|
65
|
+
clientEmail: string | null;
|
|
66
|
+
cartDiscountValue: string;
|
|
67
|
+
cartDiscountType: DiscountType | null;
|
|
68
|
+
lineDiscountTotal: string;
|
|
69
|
+
cartDiscountTotal: string;
|
|
70
|
+
taxCalculationMethod: string;
|
|
71
|
+
companyGstin: string | null;
|
|
72
|
+
companyName: string;
|
|
73
|
+
companyEmail: string | null;
|
|
74
|
+
currencyCode: string;
|
|
75
|
+
note: string | null;
|
|
76
|
+
amountPaid: string;
|
|
77
|
+
balance: string;
|
|
78
|
+
receivedByStaffId: string;
|
|
79
|
+
taxDetails: TaxDetailDto[];
|
|
80
|
+
items: InvoiceItemDto[];
|
|
81
|
+
paymentLines: InvoicePaymentLineDto[];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=invoice.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.dto.d.ts","sourceRoot":"","sources":["../../../src/api/invoices/invoice.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAErG,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MA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AAY,EAAE,qBAAqB,EAAE,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.dto.js","sourceRoot":"","sources":["../../../src/api/invoices/invoice.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { PaginatedResult } from '../pagination';
|
|
4
|
+
import type { InvoiceClientType, InvoiceItemType } from './invoice.constants';
|
|
5
|
+
import type { InvoiceDetailDto, InvoiceSummaryDto, TaxDetailDto } from './invoice.dto';
|
|
6
|
+
export type InvoiceSortBy = 'finalizedAt' | 'invoiceNumber' | 'total' | 'clientDisplayName';
|
|
7
|
+
export type InvoiceSortDirection = 'asc' | 'desc';
|
|
8
|
+
export interface ListInvoicesQuery {
|
|
9
|
+
page?: number;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
search?: string;
|
|
12
|
+
locationId?: string;
|
|
13
|
+
dateFrom?: string;
|
|
14
|
+
dateTo?: string;
|
|
15
|
+
sortBy?: InvoiceSortBy;
|
|
16
|
+
sortDir?: InvoiceSortDirection;
|
|
17
|
+
}
|
|
18
|
+
export type InvoiceListResult = PaginatedResult<InvoiceSummaryDto>;
|
|
19
|
+
export interface FinalizeInvoiceLinePreview {
|
|
20
|
+
taxAmount: string;
|
|
21
|
+
lineNet: string;
|
|
22
|
+
cartDiscountAmount: string;
|
|
23
|
+
lineTaxDetails: TaxDetailDto[];
|
|
24
|
+
}
|
|
25
|
+
export interface FinalizeInvoiceLineRequest {
|
|
26
|
+
itemType: InvoiceItemType;
|
|
27
|
+
serviceId: string;
|
|
28
|
+
serviceVariantId: string;
|
|
29
|
+
staffId: string;
|
|
30
|
+
staffId2?: string | null;
|
|
31
|
+
itemName: string;
|
|
32
|
+
staffName: string;
|
|
33
|
+
staffName2?: string | null;
|
|
34
|
+
quantity: string;
|
|
35
|
+
sortOrder: number;
|
|
36
|
+
durationMinutes?: number | null;
|
|
37
|
+
unitPrice: string;
|
|
38
|
+
lineDiscountType?: DiscountType | null;
|
|
39
|
+
lineDiscountValue?: string | null;
|
|
40
|
+
preview: FinalizeInvoiceLinePreview;
|
|
41
|
+
}
|
|
42
|
+
export interface FinalizeInvoicePaymentRequest {
|
|
43
|
+
paymentMethodId: string;
|
|
44
|
+
amount?: string;
|
|
45
|
+
tenderedAmount?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface FinalizeInvoicePreview {
|
|
48
|
+
subtotal: string;
|
|
49
|
+
lineDiscountTotal: string;
|
|
50
|
+
cartDiscountTotal: string;
|
|
51
|
+
discountTotal: string;
|
|
52
|
+
taxTotal: string;
|
|
53
|
+
grandTotal: string;
|
|
54
|
+
}
|
|
55
|
+
export interface FinalizeInvoiceRequest {
|
|
56
|
+
locationId: string;
|
|
57
|
+
/** Calendar date in company timezone — YYYY-MM-DD */
|
|
58
|
+
invoiceDate: string;
|
|
59
|
+
clientType: InvoiceClientType;
|
|
60
|
+
clientId?: string | null;
|
|
61
|
+
clientDisplayName?: string | null;
|
|
62
|
+
clientPhone?: PhoneNumberModel | null;
|
|
63
|
+
clientEmail?: string | null;
|
|
64
|
+
note?: string | null;
|
|
65
|
+
receivedByStaffId: string;
|
|
66
|
+
cartDiscountValue?: string;
|
|
67
|
+
cartDiscountType?: DiscountType | null;
|
|
68
|
+
lines: FinalizeInvoiceLineRequest[];
|
|
69
|
+
payment: FinalizeInvoicePaymentRequest;
|
|
70
|
+
preview: FinalizeInvoicePreview;
|
|
71
|
+
}
|
|
72
|
+
export type FinalizeInvoiceResponse = InvoiceDetailDto;
|
|
73
|
+
//# sourceMappingURL=invoice.requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.requests.d.ts","sourceRoot":"","sources":["../../../src/api/invoices/invoice.requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB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BAA0B,EAAE,CAAC;IACpC,OAAO,EAAE,6BAA6B,CAAC;IACvC,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.requests.js","sourceRoot":"","sources":["../../../src/api/invoices/invoice.requests.ts"],"names":[],"mappings":""}
|
package/dist/api/session.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export interface CompanyDto {
|
|
|
57
57
|
paymentGateway: string | null;
|
|
58
58
|
businessCategories: CompanyBusinessCategoryDto[];
|
|
59
59
|
primaryBusinessCategoryId: string | null;
|
|
60
|
+
taxCalculationMethod: 'inclusive' | 'exclusive';
|
|
60
61
|
}
|
|
61
62
|
export type { LocationDto, LocationDetailDto, LocationSummaryDto } from './location';
|
|
62
63
|
export interface RoleDto {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/api/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS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to } from './master';
|
|
3
|
+
|
|
4
|
+
export interface CompanySocialMediaLinksDto {
|
|
5
|
+
instagram: string | null;
|
|
6
|
+
facebook: string | null;
|
|
7
|
+
youtube: string | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CompanyProfileDto {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
logoUrl: string | null;
|
|
14
|
+
address: LocationAddressDto | null;
|
|
15
|
+
socialMediaLinks: CompanySocialMediaLinksDto;
|
|
16
|
+
giftCardExpiry: TimeFrameDto;
|
|
17
|
+
taxCalculationMethod: 'inclusive' | 'exclusive';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface UpdateCompanyProfileRequest {
|
|
21
|
+
name?: string;
|
|
22
|
+
description?: string | null;
|
|
23
|
+
logoUrl?: string | null;
|
|
24
|
+
address?: LocationAddressDto | null;
|
|
25
|
+
socialMediaLinks?: Partial<CompanySocialMediaLinksDto>;
|
|
26
|
+
giftCardExpiry?: TimeFrameDto;
|
|
27
|
+
taxCalculationMethod?: 'inclusive' | 'exclusive';
|
|
28
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './location';
|
|
|
12
12
|
export * from './platform-terms';
|
|
13
13
|
export * from './user/index';
|
|
14
14
|
export * from './company-settings/index';
|
|
15
|
+
export * from './company-profile';
|
|
15
16
|
export * from './staff/index';
|
|
16
17
|
export * from './resources/index';
|
|
17
18
|
export * from './contraindications/index';
|
|
@@ -21,3 +22,4 @@ export * from './user-roles/index';
|
|
|
21
22
|
export * from './permissions/index';
|
|
22
23
|
export * from './payment-methods/index';
|
|
23
24
|
export * from './clients/index';
|
|
25
|
+
export * from './invoices/index';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Postgres invoice status (Phase 1: paid only). Distinct from legacy Firestore InvoiceStatus enum. */
|
|
2
|
+
export const PostgresInvoiceStatus = {
|
|
3
|
+
PAID: 'paid',
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export type PostgresInvoiceStatus =
|
|
7
|
+
(typeof PostgresInvoiceStatus)[keyof typeof PostgresInvoiceStatus];
|
|
8
|
+
|
|
9
|
+
export const InvoiceClientType = {
|
|
10
|
+
WALK_IN: 'walk_in',
|
|
11
|
+
RECORDED: 'recorded',
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
export type InvoiceClientType = (typeof InvoiceClientType)[keyof typeof InvoiceClientType];
|
|
15
|
+
|
|
16
|
+
export const InvoiceItemType = {
|
|
17
|
+
SERVICE: 'service',
|
|
18
|
+
PRODUCT: 'product',
|
|
19
|
+
GIFT_CARD: 'gift_card',
|
|
20
|
+
PACKAGE: 'package',
|
|
21
|
+
APPOINTMENT: 'appointment',
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export type InvoiceItemType = (typeof InvoiceItemType)[keyof typeof InvoiceItemType];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { InvoiceClientType, InvoiceItemType, PostgresInvoiceStatus } from './invoice.constants';
|
|
4
|
+
|
|
5
|
+
export interface TaxDetailDto {
|
|
6
|
+
taxId: string | null;
|
|
7
|
+
taxName: string;
|
|
8
|
+
taxRate: string;
|
|
9
|
+
taxAmount: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface InvoiceSummaryDto {
|
|
13
|
+
id: string;
|
|
14
|
+
invoiceNumber: string;
|
|
15
|
+
financialYear: string;
|
|
16
|
+
invoiceSerial: number;
|
|
17
|
+
status: PostgresInvoiceStatus;
|
|
18
|
+
clientType: InvoiceClientType;
|
|
19
|
+
clientId: string | null;
|
|
20
|
+
clientDisplayName: string | null;
|
|
21
|
+
locationId: string;
|
|
22
|
+
outletName: string;
|
|
23
|
+
subtotal: string;
|
|
24
|
+
discountTotal: string;
|
|
25
|
+
taxTotal: string;
|
|
26
|
+
total: string;
|
|
27
|
+
invoiceDate: string;
|
|
28
|
+
finalizedAt: string;
|
|
29
|
+
receivedByStaffName: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface InvoiceItemDto {
|
|
33
|
+
id: string;
|
|
34
|
+
itemType: InvoiceItemType;
|
|
35
|
+
serviceId: string;
|
|
36
|
+
serviceVariantId: string;
|
|
37
|
+
staffId: string;
|
|
38
|
+
staffId2: string | null;
|
|
39
|
+
itemName: string;
|
|
40
|
+
staffName: string;
|
|
41
|
+
staffName2: string | null;
|
|
42
|
+
quantity: string;
|
|
43
|
+
sortOrder: number;
|
|
44
|
+
durationMinutes: number | null;
|
|
45
|
+
unitPrice: string;
|
|
46
|
+
lineSubtotal: string;
|
|
47
|
+
lineDiscountType: DiscountType | null;
|
|
48
|
+
lineDiscountValue: string | null;
|
|
49
|
+
lineDiscountAmount: string;
|
|
50
|
+
cartDiscountAmount: string;
|
|
51
|
+
lineNet: string;
|
|
52
|
+
taxAmount: string;
|
|
53
|
+
lineTotal: string;
|
|
54
|
+
taxDetails: TaxDetailDto[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface InvoicePaymentLineDto {
|
|
58
|
+
id: string;
|
|
59
|
+
paymentMethodId: string;
|
|
60
|
+
paymentMethodName: string;
|
|
61
|
+
amount: string;
|
|
62
|
+
tenderedAmount: string | null;
|
|
63
|
+
changeAmount: string | null;
|
|
64
|
+
paidAt: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface InvoiceDetailDto extends InvoiceSummaryDto {
|
|
68
|
+
clientPhone: PhoneNumberModel | null;
|
|
69
|
+
clientPhoneE164: string | null;
|
|
70
|
+
clientEmail: string | null;
|
|
71
|
+
cartDiscountValue: string;
|
|
72
|
+
cartDiscountType: DiscountType | null;
|
|
73
|
+
lineDiscountTotal: string;
|
|
74
|
+
cartDiscountTotal: string;
|
|
75
|
+
taxCalculationMethod: string;
|
|
76
|
+
companyGstin: string | null;
|
|
77
|
+
companyName: string;
|
|
78
|
+
companyEmail: string | null;
|
|
79
|
+
currencyCode: string;
|
|
80
|
+
note: string | null;
|
|
81
|
+
amountPaid: string;
|
|
82
|
+
balance: string;
|
|
83
|
+
receivedByStaffId: string;
|
|
84
|
+
taxDetails: TaxDetailDto[];
|
|
85
|
+
items: InvoiceItemDto[];
|
|
86
|
+
paymentLines: InvoicePaymentLineDto[];
|
|
87
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { PaginatedResult } from '../pagination';
|
|
4
|
+
import type { InvoiceClientType, InvoiceItemType } from './invoice.constants';
|
|
5
|
+
import type { InvoiceDetailDto, InvoiceSummaryDto, TaxDetailDto } from './invoice.dto';
|
|
6
|
+
|
|
7
|
+
export type InvoiceSortBy =
|
|
8
|
+
| 'finalizedAt'
|
|
9
|
+
| 'invoiceNumber'
|
|
10
|
+
| 'total'
|
|
11
|
+
| 'clientDisplayName';
|
|
12
|
+
|
|
13
|
+
export type InvoiceSortDirection = 'asc' | 'desc';
|
|
14
|
+
|
|
15
|
+
export interface ListInvoicesQuery {
|
|
16
|
+
page?: number;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
search?: string;
|
|
19
|
+
locationId?: string;
|
|
20
|
+
dateFrom?: string;
|
|
21
|
+
dateTo?: string;
|
|
22
|
+
sortBy?: InvoiceSortBy;
|
|
23
|
+
sortDir?: InvoiceSortDirection;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type InvoiceListResult = PaginatedResult<InvoiceSummaryDto>;
|
|
27
|
+
|
|
28
|
+
export interface FinalizeInvoiceLinePreview {
|
|
29
|
+
taxAmount: string;
|
|
30
|
+
lineNet: string;
|
|
31
|
+
cartDiscountAmount: string;
|
|
32
|
+
lineTaxDetails: TaxDetailDto[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FinalizeInvoiceLineRequest {
|
|
36
|
+
itemType: InvoiceItemType;
|
|
37
|
+
serviceId: string;
|
|
38
|
+
serviceVariantId: string;
|
|
39
|
+
staffId: string;
|
|
40
|
+
staffId2?: string | null;
|
|
41
|
+
itemName: string;
|
|
42
|
+
staffName: string;
|
|
43
|
+
staffName2?: string | null;
|
|
44
|
+
quantity: string;
|
|
45
|
+
sortOrder: number;
|
|
46
|
+
durationMinutes?: number | null;
|
|
47
|
+
unitPrice: string;
|
|
48
|
+
lineDiscountType?: DiscountType | null;
|
|
49
|
+
lineDiscountValue?: string | null;
|
|
50
|
+
preview: FinalizeInvoiceLinePreview;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FinalizeInvoicePaymentRequest {
|
|
54
|
+
paymentMethodId: string;
|
|
55
|
+
amount?: string;
|
|
56
|
+
tenderedAmount?: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface FinalizeInvoicePreview {
|
|
60
|
+
subtotal: string;
|
|
61
|
+
lineDiscountTotal: string;
|
|
62
|
+
cartDiscountTotal: string;
|
|
63
|
+
discountTotal: string;
|
|
64
|
+
taxTotal: string;
|
|
65
|
+
grandTotal: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface FinalizeInvoiceRequest {
|
|
69
|
+
locationId: string;
|
|
70
|
+
/** Calendar date in company timezone — YYYY-MM-DD */
|
|
71
|
+
invoiceDate: string;
|
|
72
|
+
clientType: InvoiceClientType;
|
|
73
|
+
clientId?: string | null;
|
|
74
|
+
clientDisplayName?: string | null;
|
|
75
|
+
clientPhone?: PhoneNumberModel | null;
|
|
76
|
+
clientEmail?: string | null;
|
|
77
|
+
note?: string | null;
|
|
78
|
+
receivedByStaffId: string;
|
|
79
|
+
cartDiscountValue?: string;
|
|
80
|
+
cartDiscountType?: DiscountType | null;
|
|
81
|
+
lines: FinalizeInvoiceLineRequest[];
|
|
82
|
+
payment: FinalizeInvoicePaymentRequest;
|
|
83
|
+
preview: FinalizeInvoicePreview;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type FinalizeInvoiceResponse = InvoiceDetailDto;
|
package/src/api/session.ts
CHANGED
|
@@ -63,6 +63,7 @@ export interface CompanyDto {
|
|
|
63
63
|
paymentGateway: string | null;
|
|
64
64
|
businessCategories: CompanyBusinessCategoryDto[];
|
|
65
65
|
primaryBusinessCategoryId: string | null;
|
|
66
|
+
taxCalculationMethod: 'inclusive' | 'exclusive';
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
export type { LocationDto, LocationDetailDto, LocationSummaryDto } from './location';
|