@ottoai/documents 1.5.3 → 1.5.6
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/create/pdf/custom-generate.d.ts +2 -0
- package/dist/create/pdf/custom-generate.js +20 -0
- package/dist/create/pdf/custom-generate.js.map +1 -0
- package/dist/create/pdf/index.d.ts +4 -3
- package/dist/create/pdf/index.js +6 -6
- package/dist/create/pdf/index.js.map +1 -1
- package/dist/create/pdf/types/index.d.ts +1 -0
- package/dist/create/pdf/types/index.js +18 -0
- package/dist/create/pdf/types/index.js.map +1 -0
- package/dist/create/pdf/types/pdf-editor.d.ts +36 -0
- package/dist/create/pdf/types/pdf-editor.js +20 -0
- package/dist/create/pdf/types/pdf-editor.js.map +1 -0
- package/dist/create/pdf/united-states/form-1099/index.js +8 -22
- package/dist/create/pdf/united-states/form-1099/index.js.map +1 -1
- package/dist/create/pdf/united-states/form-2553/form.dto.d.ts +11 -11
- package/dist/create/pdf/united-states/form-2553/form.dto.js +23 -16
- package/dist/create/pdf/united-states/form-2553/form.dto.js.map +1 -1
- package/dist/create/pdf/united-states/form-2553/index.d.ts +1 -8
- package/dist/create/pdf/united-states/form-2553/index.js +33 -112
- package/dist/create/pdf/united-states/form-2553/index.js.map +1 -1
- package/dist/create/pdf/united-states/form-2553/schema.json +15 -15
- package/dist/create/pdf/united-states/form-w8ben/index.js +8 -22
- package/dist/create/pdf/united-states/form-w8ben/index.js.map +1 -1
- package/dist/create/pdf/united-states/form-w9/form.dto.d.ts +1 -1
- package/dist/create/pdf/united-states/form-w9/form.dto.js +1 -1
- package/dist/create/pdf/united-states/form-w9/form.dto.js.map +1 -1
- package/dist/create/pdf/united-states/form-w9/index.js +8 -22
- package/dist/create/pdf/united-states/form-w9/index.js.map +1 -1
- package/dist/create/pdf/util/buffer.d.ts +0 -4
- package/dist/create/pdf/util/buffer.js +1 -31
- package/dist/create/pdf/util/buffer.js.map +1 -1
- package/dist/create/pdf/util/constants.d.ts +7 -0
- package/dist/create/pdf/util/constants.js +11 -0
- package/dist/create/pdf/util/constants.js.map +1 -0
- package/dist/create/pdf/util/format.d.ts +14 -4
- package/dist/create/pdf/util/format.js +73 -2
- package/dist/create/pdf/util/format.js.map +1 -1
- package/dist/create/pdf/util/index.d.ts +7 -0
- package/dist/create/pdf/util/index.js +30 -0
- package/dist/create/pdf/util/index.js.map +1 -0
- package/dist/create/zip/util/index.js +3 -3
- package/dist/create/zip/util/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePdf = void 0;
|
|
4
|
+
const util_1 = require("./util");
|
|
5
|
+
const generatePdf = async (data, pdfBuffer, schemas, formCoordinates) => {
|
|
6
|
+
const template = {
|
|
7
|
+
basePdf: (0, util_1.toArrayBuffer)(pdfBuffer),
|
|
8
|
+
schemas,
|
|
9
|
+
};
|
|
10
|
+
const plugins = {
|
|
11
|
+
Text: util_1.textSchema,
|
|
12
|
+
Image: util_1.imageSchema,
|
|
13
|
+
};
|
|
14
|
+
const inputs = formCoordinates(data);
|
|
15
|
+
return (0, util_1.generate)({ template, inputs, plugins }).then((pdf) => {
|
|
16
|
+
return (0, util_1.toBuffer)(pdf);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
exports.generatePdf = generatePdf;
|
|
20
|
+
//# sourceMappingURL=custom-generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-generate.js","sourceRoot":"","sources":["../../../src/create/pdf/custom-generate.ts"],"names":[],"mappings":";;;AACA,iCAMgB;AAKT,MAAM,WAAW,GAAG,KAAK,EAC9B,IAAO,EACP,SAAiB,EACjB,OAAmB,EACnB,eAAsD,EACrC,EAAE;IACnB,MAAM,QAAQ,GAAa;QACzB,OAAO,EAAE,IAAA,oBAAa,EAAC,SAAS,CAAC;QACjC,OAAO;KACR,CAAC;IAEF,MAAM,OAAO,GAAG;QACd,IAAI,EAAE,iBAAU;QAChB,KAAK,EAAE,kBAAW;KACnB,CAAC;IAEF,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1D,OAAO,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArBW,QAAA,WAAW,eAqBtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
export * as us from "./united-states";
|
|
2
|
+
export * as utils from "./util";
|
|
3
|
+
export * as types from "./types";
|
|
4
|
+
export { generatePdf } from "./custom-generate";
|
package/dist/create/pdf/index.js
CHANGED
|
@@ -23,10 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
|
|
28
|
-
exports.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Object.defineProperty(exports, "
|
|
26
|
+
exports.generatePdf = exports.types = exports.utils = exports.us = void 0;
|
|
27
|
+
exports.us = __importStar(require("./united-states"));
|
|
28
|
+
exports.utils = __importStar(require("./util"));
|
|
29
|
+
exports.types = __importStar(require("./types"));
|
|
30
|
+
var custom_generate_1 = require("./custom-generate");
|
|
31
|
+
Object.defineProperty(exports, "generatePdf", { enumerable: true, get: function () { return custom_generate_1.generatePdf; } });
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/create/pdf/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/create/pdf/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsC;AACtC,gDAAgC;AAChC,iDAAiC;AAEjC,qDAAgD;AAAvC,8GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./pdf-editor";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./pdf-editor"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/create/pdf/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Field {
|
|
2
|
+
value: string;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
page: number;
|
|
6
|
+
isImage?: boolean;
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
export type PdfCoordinates = {
|
|
10
|
+
[name: string]: Field;
|
|
11
|
+
};
|
|
12
|
+
export declare enum FedralTaxClassification {
|
|
13
|
+
IndividualSoleProprietor = "solo",
|
|
14
|
+
CCorporation = "c_corporation",
|
|
15
|
+
SCorporation = "s_corporation",
|
|
16
|
+
Partnership = "partnership",
|
|
17
|
+
TrustEstate = "trust",
|
|
18
|
+
LLC = "llc",
|
|
19
|
+
Other = "other"
|
|
20
|
+
}
|
|
21
|
+
export declare enum TaxClassification {
|
|
22
|
+
CCorporation = "c_corporation",
|
|
23
|
+
SCorporation = "s_corporation",
|
|
24
|
+
Partnership = "partnership"
|
|
25
|
+
}
|
|
26
|
+
export interface Address {
|
|
27
|
+
city: string | null;
|
|
28
|
+
state: string | null;
|
|
29
|
+
postal_code: string | null;
|
|
30
|
+
address_line_1: string | null;
|
|
31
|
+
address_line_2?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface Requester {
|
|
34
|
+
name: string;
|
|
35
|
+
address: Address;
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaxClassification = exports.FedralTaxClassification = void 0;
|
|
4
|
+
var FedralTaxClassification;
|
|
5
|
+
(function (FedralTaxClassification) {
|
|
6
|
+
FedralTaxClassification["IndividualSoleProprietor"] = "solo";
|
|
7
|
+
FedralTaxClassification["CCorporation"] = "c_corporation";
|
|
8
|
+
FedralTaxClassification["SCorporation"] = "s_corporation";
|
|
9
|
+
FedralTaxClassification["Partnership"] = "partnership";
|
|
10
|
+
FedralTaxClassification["TrustEstate"] = "trust";
|
|
11
|
+
FedralTaxClassification["LLC"] = "llc";
|
|
12
|
+
FedralTaxClassification["Other"] = "other";
|
|
13
|
+
})(FedralTaxClassification || (exports.FedralTaxClassification = FedralTaxClassification = {}));
|
|
14
|
+
var TaxClassification;
|
|
15
|
+
(function (TaxClassification) {
|
|
16
|
+
TaxClassification["CCorporation"] = "c_corporation";
|
|
17
|
+
TaxClassification["SCorporation"] = "s_corporation";
|
|
18
|
+
TaxClassification["Partnership"] = "partnership";
|
|
19
|
+
})(TaxClassification || (exports.TaxClassification = TaxClassification = {}));
|
|
20
|
+
//# sourceMappingURL=pdf-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-editor.js","sourceRoot":"","sources":["../../../../src/create/pdf/types/pdf-editor.ts"],"names":[],"mappings":";;;AAaA,IAAY,uBAQX;AARD,WAAY,uBAAuB;IACjC,4DAAiC,CAAA;IACjC,yDAA8B,CAAA;IAC9B,yDAA8B,CAAA;IAC9B,sDAA2B,CAAA;IAC3B,gDAAqB,CAAA;IACrB,sCAAW,CAAA;IACX,0CAAe,CAAA;AACjB,CAAC,EARW,uBAAuB,uCAAvB,uBAAuB,QAQlC;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,mDAA8B,CAAA;IAC9B,mDAA8B,CAAA;IAC9B,gDAA2B,CAAA;AAC7B,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -7,24 +7,21 @@ exports.form1099 = void 0;
|
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const util_1 = require("util");
|
|
9
9
|
const path_1 = require("path");
|
|
10
|
-
const
|
|
11
|
-
const text_1 = __importDefault(require("../../util/pdfme/schemas/text"));
|
|
12
|
-
const image_1 = __importDefault(require("../../util/pdfme/schemas/graphics/image"));
|
|
13
|
-
const buffer_1 = require("../../util/buffer");
|
|
14
|
-
const constants_1 = require("../constants");
|
|
10
|
+
const util_2 = require("../../util");
|
|
15
11
|
const schema_json_1 = __importDefault(require("./schema.json"));
|
|
12
|
+
const custom_generate_1 = require("../../custom-generate");
|
|
16
13
|
const readFilePromise = (0, util_1.promisify)(fs_1.readFile);
|
|
17
14
|
const w9FormCoordinates = (data) => {
|
|
18
15
|
const page3 = {
|
|
19
|
-
isVoid: data.isVoid ?
|
|
20
|
-
isCorrected: data.isCorrected ?
|
|
21
|
-
directSalesOver5000: data.directSalesOver5000 ?
|
|
22
|
-
payerDetails: (0,
|
|
16
|
+
isVoid: data.isVoid ? util_2.CHECKED_IMAGE : "",
|
|
17
|
+
isCorrected: data.isCorrected ? util_2.CHECKED_IMAGE : "",
|
|
18
|
+
directSalesOver5000: data.directSalesOver5000 ? util_2.CHECKED_IMAGE : "",
|
|
19
|
+
payerDetails: (0, util_2.formatPayerDetails)(data.payerName, data.payerAddress, data.payerPhone),
|
|
23
20
|
payerTin: data.payerTin,
|
|
24
21
|
recipientTin: data.recipientTin,
|
|
25
22
|
recipientName: data.recipientName,
|
|
26
23
|
recipientStreetAddress: data.recipientAddress.address_line_1 || "",
|
|
27
|
-
recipientFullAddress: (0,
|
|
24
|
+
recipientFullAddress: (0, util_2.formatAddress)({
|
|
28
25
|
...data.recipientAddress,
|
|
29
26
|
address_line_1: "",
|
|
30
27
|
address_line_2: "",
|
|
@@ -48,18 +45,7 @@ const getPDFInstance = async () => {
|
|
|
48
45
|
};
|
|
49
46
|
const form1099 = async (data) => {
|
|
50
47
|
const pdfBuffer = await getPDFInstance();
|
|
51
|
-
|
|
52
|
-
basePdf: (0, buffer_1.toArrayBuffer)(pdfBuffer),
|
|
53
|
-
schemas: schema_json_1.default,
|
|
54
|
-
};
|
|
55
|
-
const plugins = {
|
|
56
|
-
Text: text_1.default,
|
|
57
|
-
Image: image_1.default,
|
|
58
|
-
};
|
|
59
|
-
const inputs = w9FormCoordinates(data);
|
|
60
|
-
return (0, generator_1.generate)({ template, inputs, plugins }).then((pdf) => {
|
|
61
|
-
return (0, buffer_1.toBuffer)(pdf);
|
|
62
|
-
});
|
|
48
|
+
return (0, custom_generate_1.generatePdf)(data, pdfBuffer, schema_json_1.default, w9FormCoordinates);
|
|
63
49
|
};
|
|
64
50
|
exports.form1099 = form1099;
|
|
65
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-1099/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,+BAAiC;AACjC,+BAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-1099/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,+BAAiC;AACjC,+BAA+B;AAC/B,qCAA8E;AAC9E,gEAAuC;AAEvC,2DAAoD;AAEpD,MAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,aAAQ,CAAC,CAAC;AAE5C,MAAM,iBAAiB,GAAG,CAAC,IAAiB,EAA4B,EAAE;IACxE,MAAM,KAAK,GAAG;QACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAa,CAAC,CAAC,CAAC,EAAE;QACxC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAa,CAAC,CAAC,CAAC,EAAE;QAClD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,oBAAa,CAAC,CAAC,CAAC,EAAE;QAClE,YAAY,EAAE,IAAA,yBAAkB,EAC9B,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,CAChB;QACD,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,sBAAsB,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,IAAI,EAAE;QAClE,oBAAoB,EAAE,IAAA,oBAAa,EAAC;YAClC,GAAG,IAAI,CAAC,gBAAgB;YACxB,cAAc,EAAE,EAAE;YAClB,cAAc,EAAE,EAAE;SACnB,CAAC;QACF,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;QACvC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE;QAC3C,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,QAAQ,EAAE;QACjE,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,EAAE;QACnE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE;QACnD,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE;QACzC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE;KAC1C,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,IAAI,iBAAyB,CAAC;AAC9B,MAAM,cAAc,GAAG,KAAK,IAAqB,EAAE;IACjD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,iBAAiB,GAAG,MAAM,eAAe,CACvC,IAAA,cAAO,EAAC,SAAS,EAAE,gBAAgB,CAAC,CACrC,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAKK,MAAM,QAAQ,GAAG,KAAK,EAAE,IAAiB,EAAmB,EAAE;IACnE,MAAM,SAAS,GAAG,MAAM,cAAc,EAAE,CAAC;IACzC,OAAO,IAAA,6BAAW,EAChB,IAAI,EACJ,SAAS,EACT,qBAAU,EACV,iBAAiB,CAClB,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB"}
|
|
@@ -22,23 +22,23 @@ export declare class ShareholderDto {
|
|
|
22
22
|
taxYearEnd: string;
|
|
23
23
|
}
|
|
24
24
|
export declare class Form2553DataDto {
|
|
25
|
-
corporationName
|
|
26
|
-
corporationAddress
|
|
27
|
-
employerIdNumber
|
|
28
|
-
dateIncorporated
|
|
29
|
-
stateOfIncorporation
|
|
25
|
+
corporationName?: string;
|
|
26
|
+
corporationAddress?: AddressDto;
|
|
27
|
+
employerIdNumber?: string;
|
|
28
|
+
dateIncorporated?: string;
|
|
29
|
+
stateOfIncorporation?: string;
|
|
30
30
|
changedName?: boolean;
|
|
31
31
|
changedAddress?: boolean;
|
|
32
|
-
electionEffectiveDate
|
|
33
|
-
selectedTaxYear
|
|
32
|
+
electionEffectiveDate?: string;
|
|
33
|
+
selectedTaxYear?: TaxYearType;
|
|
34
34
|
fiscalYearEndDate?: string;
|
|
35
35
|
weekEndingMonth?: string;
|
|
36
36
|
moreThan100ShareholdersFamilyTreated?: boolean;
|
|
37
|
-
officerName
|
|
38
|
-
officerTitle
|
|
39
|
-
officerPhoneNumber
|
|
37
|
+
officerName?: string;
|
|
38
|
+
officerTitle?: string;
|
|
39
|
+
officerPhoneNumber?: string;
|
|
40
40
|
isLateElection?: boolean;
|
|
41
|
-
shareholders
|
|
41
|
+
shareholders?: ShareholderDto[];
|
|
42
42
|
formFilingDate?: string;
|
|
43
43
|
}
|
|
44
44
|
export declare class Form2553ValidationDto {
|
|
@@ -107,17 +107,20 @@ class Form2553DataDto {
|
|
|
107
107
|
}
|
|
108
108
|
exports.Form2553DataDto = Form2553DataDto;
|
|
109
109
|
__decorate([
|
|
110
|
+
(0, class_validator_1.IsOptional)(),
|
|
110
111
|
(0, class_validator_1.IsString)(),
|
|
111
112
|
(0, class_validator_1.IsNotEmpty)(),
|
|
112
113
|
(0, class_validator_1.Length)(1, 150),
|
|
113
114
|
__metadata("design:type", String)
|
|
114
115
|
], Form2553DataDto.prototype, "corporationName", void 0);
|
|
115
116
|
__decorate([
|
|
117
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
118
|
(0, class_validator_1.IsObject)(),
|
|
117
119
|
(0, class_validator_1.ValidateNested)(),
|
|
118
120
|
__metadata("design:type", AddressDto)
|
|
119
121
|
], Form2553DataDto.prototype, "corporationAddress", void 0);
|
|
120
122
|
__decorate([
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
121
124
|
(0, class_validator_1.IsString)(),
|
|
122
125
|
(0, class_validator_1.IsNotEmpty)(),
|
|
123
126
|
(0, class_validator_1.Matches)(/^\d{2}-\d{7}$|^Applied for$/, {
|
|
@@ -126,10 +129,12 @@ __decorate([
|
|
|
126
129
|
__metadata("design:type", String)
|
|
127
130
|
], Form2553DataDto.prototype, "employerIdNumber", void 0);
|
|
128
131
|
__decorate([
|
|
132
|
+
(0, class_validator_1.IsOptional)(),
|
|
129
133
|
(0, class_validator_1.IsDateString)(),
|
|
130
134
|
__metadata("design:type", String)
|
|
131
135
|
], Form2553DataDto.prototype, "dateIncorporated", void 0);
|
|
132
136
|
__decorate([
|
|
137
|
+
(0, class_validator_1.IsOptional)(),
|
|
133
138
|
(0, class_validator_1.IsString)(),
|
|
134
139
|
(0, class_validator_1.IsNotEmpty)(),
|
|
135
140
|
(0, class_validator_1.Length)(2, 50),
|
|
@@ -146,10 +151,12 @@ __decorate([
|
|
|
146
151
|
__metadata("design:type", Boolean)
|
|
147
152
|
], Form2553DataDto.prototype, "changedAddress", void 0);
|
|
148
153
|
__decorate([
|
|
154
|
+
(0, class_validator_1.IsOptional)(),
|
|
149
155
|
(0, class_validator_1.IsDateString)(),
|
|
150
156
|
__metadata("design:type", String)
|
|
151
157
|
], Form2553DataDto.prototype, "electionEffectiveDate", void 0);
|
|
152
158
|
__decorate([
|
|
159
|
+
(0, class_validator_1.IsOptional)(),
|
|
153
160
|
(0, class_validator_1.IsEnum)(TaxYearType),
|
|
154
161
|
__metadata("design:type", String)
|
|
155
162
|
], Form2553DataDto.prototype, "selectedTaxYear", void 0);
|
|
@@ -170,18 +177,21 @@ __decorate([
|
|
|
170
177
|
__metadata("design:type", Boolean)
|
|
171
178
|
], Form2553DataDto.prototype, "moreThan100ShareholdersFamilyTreated", void 0);
|
|
172
179
|
__decorate([
|
|
180
|
+
(0, class_validator_1.IsOptional)(),
|
|
173
181
|
(0, class_validator_1.IsString)(),
|
|
174
182
|
(0, class_validator_1.IsNotEmpty)(),
|
|
175
183
|
(0, class_validator_1.Length)(1, 100),
|
|
176
184
|
__metadata("design:type", String)
|
|
177
185
|
], Form2553DataDto.prototype, "officerName", void 0);
|
|
178
186
|
__decorate([
|
|
187
|
+
(0, class_validator_1.IsOptional)(),
|
|
179
188
|
(0, class_validator_1.IsString)(),
|
|
180
189
|
(0, class_validator_1.IsNotEmpty)(),
|
|
181
190
|
(0, class_validator_1.Length)(1, 50),
|
|
182
191
|
__metadata("design:type", String)
|
|
183
192
|
], Form2553DataDto.prototype, "officerTitle", void 0);
|
|
184
193
|
__decorate([
|
|
194
|
+
(0, class_validator_1.IsOptional)(),
|
|
185
195
|
(0, class_validator_1.IsString)(),
|
|
186
196
|
(0, class_validator_1.IsNotEmpty)(),
|
|
187
197
|
(0, class_validator_1.IsPhoneNumber)("US"),
|
|
@@ -193,6 +203,7 @@ __decorate([
|
|
|
193
203
|
__metadata("design:type", Boolean)
|
|
194
204
|
], Form2553DataDto.prototype, "isLateElection", void 0);
|
|
195
205
|
__decorate([
|
|
206
|
+
(0, class_validator_1.IsOptional)(),
|
|
196
207
|
(0, class_validator_1.IsArray)(),
|
|
197
208
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
198
209
|
__metadata("design:type", Array)
|
|
@@ -245,25 +256,21 @@ class Form2553ValidationDto {
|
|
|
245
256
|
}
|
|
246
257
|
static validateSCorpEligibility(data) {
|
|
247
258
|
const issues = [];
|
|
248
|
-
if (data.shareholders.length > 100) {
|
|
259
|
+
if (data.shareholders && data.shareholders?.length > 100) {
|
|
249
260
|
issues.push("S-Corporation cannot have more than 100 shareholders");
|
|
250
261
|
}
|
|
251
|
-
data.shareholders
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
if (data.shareholders) {
|
|
263
|
+
data.shareholders?.forEach((shareholder, index) => {
|
|
264
|
+
if (!shareholder.taxIdNumber) {
|
|
265
|
+
issues.push(`Shareholder ${index + 1} tax ID number is required`);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
const totalPercentage = data.shareholders?.reduce((sum, shareholder) => {
|
|
269
|
+
return sum + (shareholder.percentageOwnership || 0);
|
|
270
|
+
}, 0);
|
|
271
|
+
if (Math.abs(totalPercentage - 100) > 0.01) {
|
|
272
|
+
issues.push(`Shareholder ownership percentages must total 100%, currently ${totalPercentage}%`);
|
|
254
273
|
}
|
|
255
|
-
});
|
|
256
|
-
const totalPercentage = data.shareholders.reduce((sum, shareholder) => {
|
|
257
|
-
return sum + (shareholder.percentageOwnership || 0);
|
|
258
|
-
}, 0);
|
|
259
|
-
if (Math.abs(totalPercentage - 100) > 0.01) {
|
|
260
|
-
issues.push(`Shareholder ownership percentages must total 100%, currently ${totalPercentage}%`);
|
|
261
|
-
}
|
|
262
|
-
if (!data.corporationName) {
|
|
263
|
-
issues.push("Corporation name is required");
|
|
264
|
-
}
|
|
265
|
-
if (!data.employerIdNumber) {
|
|
266
|
-
issues.push("Employer ID number is required");
|
|
267
274
|
}
|
|
268
275
|
return {
|
|
269
276
|
isEligible: issues.length === 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.dto.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-2553/form.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAgByB;AAGzB,MAAa,UAAU;CA8BtB;AA9BD,gCA8BC;AA1BC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;kDACQ;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;kDACS;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,CAAC;;wCACD;AAKb;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,E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AAC,4BAA4B,CAAC,CAAC;gBACpE,CAAC;YACH,CAAC,CAAC,CAAC;YAGH,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE;gBACrE,OAAO,GAAG,GAAG,CAAC,WAAW,CAAC,mBAAmB,IAAI,CAAC,CAAC,CAAC;YACtD,CAAC,EAAE,CAAC,CAAC,CAAC;YAEN,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;gBAC3C,MAAM,CAAC,IAAI,CACT,gEAAgE,eAAe,GAAG,CACnF,CAAC;YACJ,CAAC;QACH,CAAC;QAeD,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC/B,MAAM;SACP,CAAC;IACJ,CAAC;CACF;AA1ID,sDA0IC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { Form2553DataDto } from "./form.dto";
|
|
2
|
-
declare const formatAddress: (addressLine1: string, addressLine2?: string, city?: string, state?: string, postalCode?: string, country?: string) => string;
|
|
3
|
-
declare const formatFullAddress: (addressLine1: string, addressLine2?: string, city?: string, state?: string, postalCode?: string, country?: string) => {
|
|
4
|
-
line1: string;
|
|
5
|
-
line2: string;
|
|
6
|
-
line3: string;
|
|
7
|
-
};
|
|
8
|
-
declare const splitTextIntoLines: (text: string, maxLength?: number) => string[];
|
|
9
2
|
declare const form2553Coordinates: (data: Form2553DataDto) => Record<string, string>[];
|
|
10
3
|
declare const validateForm2553Data: (data: Form2553DataDto) => void;
|
|
11
4
|
export declare const form2553: (data: Form2553DataDto) => Promise<Buffer>;
|
|
12
|
-
export { validateForm2553Data,
|
|
5
|
+
export { validateForm2553Data, form2553Coordinates };
|
|
13
6
|
export declare const generateForm2553WithValidation: (data: Form2553DataDto, options?: {
|
|
14
7
|
skipSignatureValidation?: boolean;
|
|
15
8
|
skipOwnershipValidation?: boolean;
|