@ottoai/documents 1.5.21 → 1.5.24
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/united-states/form-1099-nec/schema.json +3 -3
- package/dist/create/pdf/united-states/form-4868/form.dto.d.ts +21 -0
- package/dist/create/pdf/united-states/form-4868/form.dto.js +93 -0
- package/dist/create/pdf/united-states/form-4868/form.dto.js.map +1 -0
- package/dist/create/pdf/united-states/form-4868/index.d.ts +4 -0
- package/dist/create/pdf/united-states/form-4868/index.js +87 -0
- package/dist/create/pdf/united-states/form-4868/index.js.map +1 -0
- package/dist/create/pdf/united-states/form-4868/schema.json +359 -0
- package/dist/create/pdf/united-states/form-4868/template.pdf +0 -0
- package/dist/create/pdf/united-states/form-8821/form.dto.d.ts +41 -0
- package/dist/create/pdf/united-states/form-8821/form.dto.js +220 -0
- package/dist/create/pdf/united-states/form-8821/form.dto.js.map +1 -0
- package/dist/create/pdf/united-states/form-8821/index.d.ts +5 -0
- package/dist/create/pdf/united-states/form-8821/index.js +146 -0
- package/dist/create/pdf/united-states/form-8821/index.js.map +1 -0
- package/dist/create/pdf/united-states/form-8821/schema.json +924 -0
- package/dist/create/pdf/united-states/form-8821/template.pdf +0 -0
- package/dist/create/pdf/united-states/index.d.ts +8 -2
- package/dist/create/pdf/united-states/index.js +12 -1
- package/dist/create/pdf/united-states/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Form8821DataDto = exports.TaxInformationDto = exports.DesigneeDto = exports.AddressDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
class AddressDto {
|
|
16
|
+
}
|
|
17
|
+
exports.AddressDto = AddressDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, class_validator_1.Length)(1, 100),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], AddressDto.prototype, "address_line_1", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.Length)(1, 100),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], AddressDto.prototype, "address_line_2", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
+
(0, class_validator_1.Length)(1, 50),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], AddressDto.prototype, "city", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
+
(0, class_validator_1.Length)(2, 50),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AddressDto.prototype, "state", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
(0, class_validator_1.Matches)(/^\d{5}(-\d{4})?$/, { message: "Invalid ZIP code format" }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], AddressDto.prototype, "postal_code", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
(0, class_validator_1.Length)(2, 50),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], AddressDto.prototype, "country", void 0);
|
|
54
|
+
class DesigneeDto {
|
|
55
|
+
}
|
|
56
|
+
exports.DesigneeDto = DesigneeDto;
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
60
|
+
(0, class_validator_1.Length)(1, 100),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], DesigneeDto.prototype, "name", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsObject)(),
|
|
65
|
+
(0, class_validator_1.ValidateNested)(),
|
|
66
|
+
(0, class_transformer_1.Type)(() => AddressDto),
|
|
67
|
+
__metadata("design:type", AddressDto)
|
|
68
|
+
], DesigneeDto.prototype, "address", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsBoolean)(),
|
|
72
|
+
__metadata("design:type", Boolean)
|
|
73
|
+
], DesigneeDto.prototype, "sendCopies", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
(0, class_validator_1.Length)(1, 50),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], DesigneeDto.prototype, "cafNumber", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
(0, class_validator_1.IsString)(),
|
|
83
|
+
(0, class_validator_1.Length)(1, 50),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], DesigneeDto.prototype, "ptin", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_validator_1.IsString)(),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], DesigneeDto.prototype, "telephoneNumber", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, class_validator_1.IsOptional)(),
|
|
93
|
+
(0, class_validator_1.IsString)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], DesigneeDto.prototype, "faxNumber", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsArray)(),
|
|
99
|
+
__metadata("design:type", Array)
|
|
100
|
+
], DesigneeDto.prototype, "checkIfNew", void 0);
|
|
101
|
+
class TaxInformationDto {
|
|
102
|
+
}
|
|
103
|
+
exports.TaxInformationDto = TaxInformationDto;
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsString)(),
|
|
106
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
107
|
+
(0, class_validator_1.Length)(1, 100),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], TaxInformationDto.prototype, "typeOfTaxInformation", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, class_validator_1.IsString)(),
|
|
112
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
113
|
+
(0, class_validator_1.Length)(1, 50),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], TaxInformationDto.prototype, "taxFormNumber", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, class_validator_1.IsString)(),
|
|
118
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
119
|
+
(0, class_validator_1.Length)(1, 100),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], TaxInformationDto.prototype, "yearsOrPeriods", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
124
|
+
(0, class_validator_1.IsString)(),
|
|
125
|
+
(0, class_validator_1.Length)(1, 200),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], TaxInformationDto.prototype, "specificTaxMatters", void 0);
|
|
128
|
+
class Form8821DataDto {
|
|
129
|
+
}
|
|
130
|
+
exports.Form8821DataDto = Form8821DataDto;
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, class_validator_1.IsOptional)(),
|
|
133
|
+
(0, class_validator_1.IsString)(),
|
|
134
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
135
|
+
(0, class_validator_1.Length)(1, 200),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], Form8821DataDto.prototype, "taxpayerName", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, class_validator_1.IsOptional)(),
|
|
140
|
+
(0, class_validator_1.IsObject)(),
|
|
141
|
+
(0, class_validator_1.ValidateNested)(),
|
|
142
|
+
(0, class_transformer_1.Type)(() => AddressDto),
|
|
143
|
+
__metadata("design:type", AddressDto)
|
|
144
|
+
], Form8821DataDto.prototype, "taxpayerAddress", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, class_validator_1.IsOptional)(),
|
|
147
|
+
(0, class_validator_1.IsString)(),
|
|
148
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
149
|
+
(0, class_validator_1.Matches)(/^\d{3}-\d{2}-\d{4}$|^\d{2}-\d{7}$/, {
|
|
150
|
+
message: "Must be valid SSN (XXX-XX-XXXX) or EIN (XX-XXXXXXX) format",
|
|
151
|
+
}),
|
|
152
|
+
__metadata("design:type", String)
|
|
153
|
+
], Form8821DataDto.prototype, "taxpayerIdNumber", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, class_validator_1.IsOptional)(),
|
|
156
|
+
(0, class_validator_1.IsString)(),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], Form8821DataDto.prototype, "daytimeTelephone", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, class_validator_1.IsOptional)(),
|
|
161
|
+
(0, class_validator_1.IsString)(),
|
|
162
|
+
(0, class_validator_1.Length)(1, 50),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], Form8821DataDto.prototype, "planNumber", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, class_validator_1.IsOptional)(),
|
|
167
|
+
(0, class_validator_1.IsBoolean)(),
|
|
168
|
+
__metadata("design:type", Boolean)
|
|
169
|
+
], Form8821DataDto.prototype, "hasAdditionalDesignees", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, class_validator_1.IsOptional)(),
|
|
172
|
+
(0, class_validator_1.IsArray)(),
|
|
173
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
174
|
+
(0, class_transformer_1.Type)(() => DesigneeDto),
|
|
175
|
+
__metadata("design:type", Array)
|
|
176
|
+
], Form8821DataDto.prototype, "designees", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, class_validator_1.IsOptional)(),
|
|
179
|
+
(0, class_validator_1.IsBoolean)(),
|
|
180
|
+
__metadata("design:type", Boolean)
|
|
181
|
+
], Form8821DataDto.prototype, "authorizeIntermediateServiceProvider", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, class_validator_1.IsOptional)(),
|
|
184
|
+
(0, class_validator_1.IsArray)(),
|
|
185
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
186
|
+
(0, class_transformer_1.Type)(() => TaxInformationDto),
|
|
187
|
+
__metadata("design:type", Array)
|
|
188
|
+
], Form8821DataDto.prototype, "taxInformation", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, class_validator_1.IsOptional)(),
|
|
191
|
+
(0, class_validator_1.IsBoolean)(),
|
|
192
|
+
__metadata("design:type", Boolean)
|
|
193
|
+
], Form8821DataDto.prototype, "specificUseNotRecordedOnCAF", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, class_validator_1.IsOptional)(),
|
|
196
|
+
(0, class_validator_1.IsBoolean)(),
|
|
197
|
+
__metadata("design:type", Boolean)
|
|
198
|
+
], Form8821DataDto.prototype, "retainPriorAuthorizations", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, class_validator_1.IsString)(),
|
|
201
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
202
|
+
__metadata("design:type", String)
|
|
203
|
+
], Form8821DataDto.prototype, "signature", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, class_validator_1.IsDateString)(),
|
|
206
|
+
__metadata("design:type", String)
|
|
207
|
+
], Form8821DataDto.prototype, "signatureDate", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, class_validator_1.IsString)(),
|
|
210
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
211
|
+
(0, class_validator_1.Length)(1, 100),
|
|
212
|
+
__metadata("design:type", String)
|
|
213
|
+
], Form8821DataDto.prototype, "printName", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
(0, class_validator_1.IsOptional)(),
|
|
216
|
+
(0, class_validator_1.IsString)(),
|
|
217
|
+
(0, class_validator_1.Length)(1, 100),
|
|
218
|
+
__metadata("design:type", String)
|
|
219
|
+
], Form8821DataDto.prototype, "title", void 0);
|
|
220
|
+
//# sourceMappingURL=form.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.dto.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-8821/form.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAWyB;AACzB,yDAAyC;AAGzC,MAAa,UAAU;CA8BtB;AA9BD,gCA8BC;AA1BC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,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ataDto) => Record<string, string>[];
|
|
3
|
+
declare const validateForm8821Data: (data: Form8821DataDto) => void;
|
|
4
|
+
export declare const form8821: (data: Form8821DataDto) => Promise<Buffer>;
|
|
5
|
+
export { validateForm8821Data, form8821Coordinates };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.form8821Coordinates = exports.validateForm8821Data = exports.form8821 = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const util_1 = require("util");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const date_fns_1 = require("date-fns");
|
|
11
|
+
const is_base64_1 = __importDefault(require("is-base64"));
|
|
12
|
+
const util_2 = require("../../util");
|
|
13
|
+
const schema_json_1 = __importDefault(require("./schema.json"));
|
|
14
|
+
const custom_generate_1 = require("../../custom-generate");
|
|
15
|
+
const readFilePromise = (0, util_1.promisify)(fs_1.readFile);
|
|
16
|
+
const form8821Coordinates = (data) => {
|
|
17
|
+
const page0 = {};
|
|
18
|
+
const taxpayerAddressParts = [
|
|
19
|
+
data.taxpayerAddress?.address_line_1,
|
|
20
|
+
data.taxpayerAddress?.address_line_2,
|
|
21
|
+
data.taxpayerAddress?.city,
|
|
22
|
+
data.taxpayerAddress?.state,
|
|
23
|
+
data.taxpayerAddress?.postal_code,
|
|
24
|
+
data.taxpayerAddress?.country &&
|
|
25
|
+
data.taxpayerAddress?.country !== "United States" &&
|
|
26
|
+
data.taxpayerAddress?.country !== "US"
|
|
27
|
+
? data.taxpayerAddress?.country
|
|
28
|
+
: "",
|
|
29
|
+
]
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(", ");
|
|
32
|
+
const taxpayerNameAddress = [data.taxpayerName || "", taxpayerAddressParts]
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.join("\n");
|
|
35
|
+
page0.tax_payer_name_address = taxpayerNameAddress;
|
|
36
|
+
page0.taxpayerIdNumber = data.taxpayerIdNumber || "";
|
|
37
|
+
page0.daytimeTelephone = data.daytimeTelephone || "";
|
|
38
|
+
page0.planNumber = data.planNumber || "";
|
|
39
|
+
if (data.hasAdditionalDesignees) {
|
|
40
|
+
page0.hasAdditionalDesignees = util_2.CHECKED_IMAGE;
|
|
41
|
+
}
|
|
42
|
+
if (data.designees && data.designees.length > 0) {
|
|
43
|
+
data.designees
|
|
44
|
+
.slice(0, 2)
|
|
45
|
+
.forEach((designee, index) => {
|
|
46
|
+
const designeeNum = index + 1;
|
|
47
|
+
const designeeAddressParts = [
|
|
48
|
+
designee.address?.address_line_1,
|
|
49
|
+
designee.address?.address_line_2,
|
|
50
|
+
designee.address?.city,
|
|
51
|
+
designee.address?.state,
|
|
52
|
+
designee.address?.postal_code,
|
|
53
|
+
designee.address?.country &&
|
|
54
|
+
designee.address?.country !== "United States" &&
|
|
55
|
+
designee.address?.country !== "US"
|
|
56
|
+
? designee.address?.country
|
|
57
|
+
: "",
|
|
58
|
+
]
|
|
59
|
+
.filter(Boolean)
|
|
60
|
+
.join(", ");
|
|
61
|
+
const designeeNameAddress = [designee.name || "", designeeAddressParts]
|
|
62
|
+
.filter(Boolean)
|
|
63
|
+
.join("\n");
|
|
64
|
+
page0[`designee_name_address_${designeeNum}`] = designeeNameAddress;
|
|
65
|
+
if (designee.sendCopies) {
|
|
66
|
+
page0[`designee_sendCopies_${designeeNum}`] = util_2.CHECKED_IMAGE;
|
|
67
|
+
}
|
|
68
|
+
page0[`designee_cafNo_${designeeNum}`] = designee.cafNumber || "";
|
|
69
|
+
page0[`designee_ptin_${designeeNum}`] = designee.ptin || "";
|
|
70
|
+
page0[`designee_telephoneNo_${designeeNum}`] =
|
|
71
|
+
designee.telephoneNumber || "";
|
|
72
|
+
page0[`designee_faxNumber_${designeeNum}`] = designee.faxNumber || "";
|
|
73
|
+
if (designee.checkIfNew && Array.isArray(designee.checkIfNew)) {
|
|
74
|
+
if (designee.checkIfNew.includes("address")) {
|
|
75
|
+
page0[`designee_checkIfNew_address_${designeeNum}`] = util_2.CHECKED_IMAGE;
|
|
76
|
+
}
|
|
77
|
+
if (designee.checkIfNew.includes("telephone_no")) {
|
|
78
|
+
page0[`designee_checkIfNew_telephoneNo_${designeeNum}`] =
|
|
79
|
+
util_2.CHECKED_IMAGE;
|
|
80
|
+
}
|
|
81
|
+
if (designee.checkIfNew.includes("fax_no")) {
|
|
82
|
+
page0[`designee_checkIfNew_faxNo_${designeeNum}`] = util_2.CHECKED_IMAGE;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (data.authorizeIntermediateServiceProvider) {
|
|
88
|
+
page0.authorizeIntermediateServiceProvider = util_2.CHECKED_IMAGE;
|
|
89
|
+
}
|
|
90
|
+
if (data.taxInformation && data.taxInformation.length > 0) {
|
|
91
|
+
data.taxInformation
|
|
92
|
+
.slice(0, 3)
|
|
93
|
+
.forEach((tax, index) => {
|
|
94
|
+
const taxNum = index + 1;
|
|
95
|
+
page0[`taxInformation_type_${taxNum}`] = tax.typeOfTaxInformation || "";
|
|
96
|
+
page0[`taxInformation_form_${taxNum}`] = tax.taxFormNumber || "";
|
|
97
|
+
page0[`taxInformation_year_${taxNum}`] = tax.yearsOrPeriods || "";
|
|
98
|
+
page0[`taxInformation_specific_${taxNum}`] =
|
|
99
|
+
tax.specificTaxMatters || "";
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (data.specificUseNotRecordedOnCAF) {
|
|
103
|
+
page0.specificUseNotRecordedOnCAF = util_2.CHECKED_IMAGE;
|
|
104
|
+
}
|
|
105
|
+
else if (data.retainPriorAuthorizations) {
|
|
106
|
+
page0.retainPriorAuthorizations = util_2.CHECKED_IMAGE;
|
|
107
|
+
}
|
|
108
|
+
page0.signature = data.signature || "";
|
|
109
|
+
page0.signatureDate = data.signatureDate
|
|
110
|
+
? (0, date_fns_1.format)(new Date(data.signatureDate), util_2.DOCUMENTS_DATE_FORMAT)
|
|
111
|
+
: "";
|
|
112
|
+
page0.printName = data.printName || "";
|
|
113
|
+
page0.title = data.title || "";
|
|
114
|
+
return [{ ...page0 }];
|
|
115
|
+
};
|
|
116
|
+
exports.form8821Coordinates = form8821Coordinates;
|
|
117
|
+
let pdfBufferInstance;
|
|
118
|
+
const getPDFInstance = async () => {
|
|
119
|
+
if (!pdfBufferInstance) {
|
|
120
|
+
pdfBufferInstance = await readFilePromise((0, path_1.resolve)(__dirname, "./template.pdf"));
|
|
121
|
+
}
|
|
122
|
+
return pdfBufferInstance;
|
|
123
|
+
};
|
|
124
|
+
const validateForm8821Data = (data) => {
|
|
125
|
+
if (!(0, is_base64_1.default)(data.signature, { mimeRequired: true })) {
|
|
126
|
+
throw new Error("Invalid signature");
|
|
127
|
+
}
|
|
128
|
+
if (data.taxpayerIdNumber &&
|
|
129
|
+
!/^\d{3}-\d{2}-\d{4}$|^\d{2}-\d{7}$/.test(data.taxpayerIdNumber)) {
|
|
130
|
+
throw new Error("Invalid taxpayer ID format. Must be SSN (XXX-XX-XXXX) or EIN (XX-XXXXXXX)");
|
|
131
|
+
}
|
|
132
|
+
if (data.designees && data.designees.length > 2) {
|
|
133
|
+
console.warn("Only the first 2 designees will be included in the PDF");
|
|
134
|
+
}
|
|
135
|
+
if (data.taxInformation && data.taxInformation.length > 3) {
|
|
136
|
+
console.warn("Only the first 3 tax information entries will be included in the PDF");
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
exports.validateForm8821Data = validateForm8821Data;
|
|
140
|
+
const form8821 = async (data) => {
|
|
141
|
+
validateForm8821Data(data);
|
|
142
|
+
const pdfBuffer = await getPDFInstance();
|
|
143
|
+
return (0, custom_generate_1.generatePdf)(data, pdfBuffer, schema_json_1.default, form8821Coordinates);
|
|
144
|
+
};
|
|
145
|
+
exports.form8821 = form8821;
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-8821/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,+BAAiC;AACjC,+BAA+B;AAC/B,uCAAkC;AAClC,0DAAiC;AACjC,qCAAkE;AAClE,gEAA2C;AAE3C,2DAAoD;AAEpD,MAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,aAAQ,CAAC,CAAC;AAK5C,MAAM,mBAAmB,GAAG,CAC1B,IAAqB,EACK,EAAE;IAC5B,MAAM,KAAK,GAA2B,EAAE,CAAC;IAGzC,MAAM,oBAAoB,GAAG;QAC3B,IAAI,CAAC,eAAe,EAAE,cAAc;QACpC,IAAI,CAAC,eAAe,EAAE,cAAc;QACpC,IAAI,CAAC,eAAe,EAAE,IAAI;QAC1B,IAAI,CAAC,eAAe,EAAE,KAAK;QAC3B,IAAI,CAAC,eAAe,EAAE,WAAW;QACjC,IAAI,CAAC,eAAe,EAAE,OAAO;YAC7B,IAAI,CAAC,eAAe,EAAE,OAAO,KAAK,eAAe;YACjD,IAAI,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI;YACpC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO;YAC/B,CAAC,CAAC,EAAE;KACP;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,mBAAmB,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,oBAAoB,CAAC;SACxE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,KAAK,CAAC,sBAAsB,GAAG,mBAAmB,CAAC;IACnD,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAC;IACrD,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IA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