Skip to content

Commit 82f0bab

Browse files
committed
Added a new function for searching data in the VAT registry.
1 parent a9dbd68 commit 82f0bab

18 files changed

+796
-246
lines changed

example/example.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,10 @@ nip24.getWhitelistStatusExt(NIP24.Number.NIP, nip, account_number).then((whiteli
8989
}).catch((e) => {
9090
console.log(e.message);
9191
});
92+
93+
// Wywołanie metody wyszukującej dane w rejestrze VAT
94+
nip24.searchVATRegistryExt(NIP24.Number.NIP, nip).then((result) => {
95+
console.log(result.toString());
96+
}).catch((e) => {
97+
console.log(e.message);
98+
});

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24example",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"description": "NIP24 Client for Javascript - Example",
55
"author": "",
66
"license": "Apache-2.0",

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
module.exports = {
2525
AccountStatus: require('./lib/accountstatus'),
2626
AllData: require('./lib/alldata'),
27+
Err: require('./lib/error'),
2728
EUVAT: require('./lib/euvat'),
2829
IBAN: require('./lib/iban'),
2930
IBANStatus: require('./lib/ibanstatus'),
@@ -34,6 +35,9 @@ module.exports = {
3435
Number: require('./lib/number'),
3536
PKD: require('./lib/pkd'),
3637
REGON: require('./lib/regon'),
38+
SearchResult: require('./lib/searchresult'),
39+
VATEntity: require('./lib/vatentity'),
40+
VATPerson: require('./lib/vatperson'),
3741
VATStatus: require('./lib/vatstatus'),
3842
VIESData: require('./lib/viesdata'),
3943
WLStatus: require('./lib/wlstatus')

lib/accountstatus.js

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ function AccountStatus()
2828
{
2929
this.uid = undefined;
3030

31+
this.type = undefined;
32+
this.validTo = undefined;
3133
this.billingPlanName = undefined;
3234

3335
this.subscriptionPrice = undefined;
@@ -37,6 +39,7 @@ function AccountStatus()
3739
this.itemPriceAll = undefined;
3840
this.itemPriceIBAN = undefined;
3941
this.itemPriceWhitelist = undefined;
42+
this.itemPriceSearchVAT = undefined;
4043

4144
this.limit = undefined;
4245
this.requestDelay = undefined;
@@ -60,6 +63,7 @@ function AccountStatus()
6063
this.funcGetVATStatus = undefined;
6164
this.funcGetIBANStatus = undefined;
6265
this.funcGetWhitelistStatus = undefined;
66+
this.funcSearchVAT = undefined;
6367

6468
this.invoiceDataCount = undefined;
6569
this.allDataCount = undefined;
@@ -68,6 +72,7 @@ function AccountStatus()
6872
this.viesStatusCount = undefined;
6973
this.ibanStatusCount = undefined;
7074
this.whitelistStatusCount = undefined;
75+
this.searchVATCount = undefined;
7176
this.totalCount = undefined;
7277
}
7378

@@ -76,49 +81,54 @@ function AccountStatus()
7681
* @return {string} object info
7782
*/
7883
AccountStatus.prototype.toString = function() {
79-
return "AccountStatus: [uid = " + this.uid
80-
+ ", billingPlanName = " + this.billingPlanName
81-
82-
+ ", subscriptionPrice = " + this.subscriptionPrice
83-
+ ", itemPrice = " + this.itemPrice
84-
+ ", itemPriceStatus = " + this.itemPriceStatus
85-
+ ", itemPriceInvoice = " + this.itemPriceInvoice
86-
+ ", itemPriceAll = " + this.itemPriceAll
87-
+ ", itemPriceIBAN = " + this.itemPriceIBAN
88-
+ ", itemPriceWhitelist = " + this.itemPriceWhitelist
89-
90-
+ ", limit = " + this.limit
91-
+ ", requestDelay = " + this.requestDelay
92-
+ ", domainLimit = " + this.domainLimit
93-
94-
+ ", overPlanAllowed = " + this.overPlanAllowed
95-
+ ", terytCodes = " + this.terytCodes
96-
+ ", excelAddIn = " + this.excelAddIn
97-
+ ", jpkVat = " + this.jpkVat
98-
+ ", stats = " + this.stats
99-
+ ", NIPMonitor = " + this.nipMonitor
100-
101-
+ ", searchByNIP = " + this.searchByNIP
102-
+ ", searchByREGON = " + this.searchByREGON
103-
+ ", searchByKRS = " + this.searchByKRS
104-
105-
+ ", funcIsActive = " + this.funcIsActive
106-
+ ", funcGetInvoiceData = " + this.funcGetInvoiceData
107-
+ ", funcGetAllData = " + this.funcGetAllData
108-
+ ", funcGetVIESData = " + this.funcGetVIESData
109-
+ ", funcGetVATStatus = " + this.funcGetVATStatus
110-
+ ", funcGetIBANStatus = " + this.funcGetIBANStatus
111-
+ ", funcGetWhitelistStatus = " + this.funcGetWhitelistStatus
112-
113-
+ ", invoiceDataCount = " + this.invoiceDataCount
114-
+ ", allDataCount = " + this.allDataCount
115-
+ ", firmStatusCount = " + this.firmStatusCount
116-
+ ", VATStatusCount = " + this.vatStatusCount
117-
+ ", VIESStatusCount = " + this.viesStatusCount
118-
+ ", IBANStatusCount = " + this.ibanStatusCount
119-
+ ", whitelistStatusCount = " + this.whitelistStatusCount
120-
+ ", totalCount = " + this.totalCount
121-
+ "]";
84+
return 'AccountStatus: [uid = ' + this.uid
85+
+ ', type = ' + this.type
86+
+ ', validTo = ' + this.validTo
87+
+ ', billingPlanName = ' + this.billingPlanName
88+
89+
+ ', subscriptionPrice = ' + this.subscriptionPrice
90+
+ ', itemPrice = ' + this.itemPrice
91+
+ ', itemPriceStatus = ' + this.itemPriceStatus
92+
+ ', itemPriceInvoice = ' + this.itemPriceInvoice
93+
+ ', itemPriceAll = ' + this.itemPriceAll
94+
+ ', itemPriceIBAN = ' + this.itemPriceIBAN
95+
+ ', itemPriceWhitelist = ' + this.itemPriceWhitelist
96+
+ ', itemPriceSearchVAT = ' + this.itemPriceSearchVAT
97+
98+
+ ', limit = ' + this.limit
99+
+ ', requestDelay = ' + this.requestDelay
100+
+ ', domainLimit = ' + this.domainLimit
101+
102+
+ ', overPlanAllowed = ' + this.overPlanAllowed
103+
+ ', terytCodes = ' + this.terytCodes
104+
+ ', excelAddIn = ' + this.excelAddIn
105+
+ ', jpkVat = ' + this.jpkVat
106+
+ ', stats = ' + this.stats
107+
+ ', NIPMonitor = ' + this.nipMonitor
108+
109+
+ ', searchByNIP = ' + this.searchByNIP
110+
+ ', searchByREGON = ' + this.searchByREGON
111+
+ ', searchByKRS = ' + this.searchByKRS
112+
113+
+ ', funcIsActive = ' + this.funcIsActive
114+
+ ', funcGetInvoiceData = ' + this.funcGetInvoiceData
115+
+ ', funcGetAllData = ' + this.funcGetAllData
116+
+ ', funcGetVIESData = ' + this.funcGetVIESData
117+
+ ', funcGetVATStatus = ' + this.funcGetVATStatus
118+
+ ', funcGetIBANStatus = ' + this.funcGetIBANStatus
119+
+ ', funcGetWhitelistStatus = ' + this.funcGetWhitelistStatus
120+
+ ', funcSearchVAT = ' + this.funcSearchVAT
121+
122+
+ ', invoiceDataCount = ' + this.invoiceDataCount
123+
+ ', allDataCount = ' + this.allDataCount
124+
+ ', firmStatusCount = ' + this.firmStatusCount
125+
+ ', VATStatusCount = ' + this.vatStatusCount
126+
+ ', VIESStatusCount = ' + this.viesStatusCount
127+
+ ', IBANStatusCount = ' + this.ibanStatusCount
128+
+ ', whitelistStatusCount = ' + this.whitelistStatusCount
129+
+ ', searchVATCount = ' + this.searchVATCount
130+
+ ', totalCount = ' + this.totalCount
131+
+ ']';
122132
};
123133

124134
module.exports = AccountStatus;

lib/alldata.js

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -91,64 +91,64 @@ function AllData()
9191
* @return {string} object info
9292
*/
9393
AllData.prototype.toString = function() {
94-
return "AllData: [uid = " + this.uid
95-
+ ", nip = " + this.nip
96-
+ ", regon = " + this.regon
97-
+ ", type = " + this.type
98-
99-
+ ", name = " + this.name
100-
+ ", shortName = " + this.shortName
101-
+ ", firstName = " + this.firstName
102-
+ ", secondName = " + this.secondName
103-
+ ", lastName = " + this.lastName
104-
105-
+ ", street = " + this.street
106-
+ ", streetCode = " + this.streetCode
107-
+ ", streetNumber = " + this.streetNumber
108-
+ ", houseNumber = " + this.houseNumber
109-
+ ", city = " + this.city
110-
+ ", cityCode = " + this.cityCode
111-
+ ", community = " + this.community
112-
+ ", communityCode = " + this.communityCode
113-
+ ", county = " + this.county
114-
+ ", countyCode = " + this.countyCode
115-
+ ", state = " + this.state
116-
+ ", stateCode = " + this.stateCode
117-
+ ", postCode = " + this.postCode
118-
+ ", postCity = " + this.postCity
119-
120-
+ ", phone = " + this.phone
121-
+ ", email = " + this.email
122-
+ ", www = " + this.www
123-
124-
+ ", creationDate = " + this.creationDate
125-
+ ", startDate = " + this.startDate
126-
+ ", registrationDate = " + this.registrationDate
127-
+ ", holdDate = " + this.holdDate
128-
+ ", renevalDate = " + this.renevalDate
129-
+ ", lastUpdateDate = " + this.lastUpdateDate
130-
+ ", endDate = " + this.endDate
131-
132-
+ ", registryEntityCode = " + this.registryEntityCode
133-
+ ", registryEntityName = " + this.registryEntityName
134-
135-
+ ", registryCode = " + this.registryCode
136-
+ ", registryName = " + this.registryName
137-
138-
+ ", recordCreationDate = " + this.recordCreationDate
139-
+ ", recordNumber = " + this.recordNumber
140-
141-
+ ", basicLegalFormCode = " + this.basicLegalFormCode
142-
+ ", basicLegalFormName = " + this.basicLegalFormName
143-
144-
+ ", specificLegalFormCode = " + this.specificLegalFormCode
145-
+ ", specificLegalFormName = " + this.specificLegalFormName
146-
147-
+ ", ownershipFormCode = " + this.ownershipFormCode
148-
+ ", ownershipFormName = " + this.ownershipFormName
149-
150-
+ ", pkd = " + this.pkd
151-
+ "]";
94+
return 'AllData: [uid = ' + this.uid
95+
+ ', nip = ' + this.nip
96+
+ ', regon = ' + this.regon
97+
+ ', type = ' + this.type
98+
99+
+ ', name = ' + this.name
100+
+ ', shortName = ' + this.shortName
101+
+ ', firstName = ' + this.firstName
102+
+ ', secondName = ' + this.secondName
103+
+ ', lastName = ' + this.lastName
104+
105+
+ ', street = ' + this.street
106+
+ ', streetCode = ' + this.streetCode
107+
+ ', streetNumber = ' + this.streetNumber
108+
+ ', houseNumber = ' + this.houseNumber
109+
+ ', city = ' + this.city
110+
+ ', cityCode = ' + this.cityCode
111+
+ ', community = ' + this.community
112+
+ ', communityCode = ' + this.communityCode
113+
+ ', county = ' + this.county
114+
+ ', countyCode = ' + this.countyCode
115+
+ ', state = ' + this.state
116+
+ ', stateCode = ' + this.stateCode
117+
+ ', postCode = ' + this.postCode
118+
+ ', postCity = ' + this.postCity
119+
120+
+ ', phone = ' + this.phone
121+
+ ', email = ' + this.email
122+
+ ', www = ' + this.www
123+
124+
+ ', creationDate = ' + this.creationDate
125+
+ ', startDate = ' + this.startDate
126+
+ ', registrationDate = ' + this.registrationDate
127+
+ ', holdDate = ' + this.holdDate
128+
+ ', renevalDate = ' + this.renevalDate
129+
+ ', lastUpdateDate = ' + this.lastUpdateDate
130+
+ ', endDate = ' + this.endDate
131+
132+
+ ', registryEntityCode = ' + this.registryEntityCode
133+
+ ', registryEntityName = ' + this.registryEntityName
134+
135+
+ ', registryCode = ' + this.registryCode
136+
+ ', registryName = ' + this.registryName
137+
138+
+ ', recordCreationDate = ' + this.recordCreationDate
139+
+ ', recordNumber = ' + this.recordNumber
140+
141+
+ ', basicLegalFormCode = ' + this.basicLegalFormCode
142+
+ ', basicLegalFormName = ' + this.basicLegalFormName
143+
144+
+ ', specificLegalFormCode = ' + this.specificLegalFormCode
145+
+ ', specificLegalFormName = ' + this.specificLegalFormName
146+
147+
+ ', ownershipFormCode = ' + this.ownershipFormCode
148+
+ ', ownershipFormName = ' + this.ownershipFormName
149+
150+
+ ', pkd = [' + this.pkd + ']'
151+
+ ']';
152152
};
153153

154154
module.exports = AllData;

0 commit comments

Comments
 (0)