This repository was archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathprofile.js
54 lines (50 loc) · 2 KB
/
profile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { fetchFactory, URL, fixtures } from './utils'
var name = 'profile'
export default fetchFactory({
url: URL[name],
fixture: fixtures[name],
parser: parseProfile,
})
/**
* Подробная информация о контрагенте
* @param {string} name — наименование контрагента
* @param {string} full_name — полное наименование контрагента
* @param {string} INN — ИНН контрагента
* @param {string} KPP — КПП контрагента
* @param {string} OKPO — ОКПО контрагента
* @param {string} Jur_address — юридический адрес контрагента
* @param {string} Fact_address — фактический адрес контрагента
* @param {string} Phone — телефоны контрагента
* @param {string} bank_account — номер расчетного счета контрагента
* @param {string} corr_account — номер корр счета
* @param {string} Bank_name — наименование банка в котором открыт счет
* @param {string} BIK — БИК банка
* @param {string} Bank_address — адрес банка
*/
export class Profile {
constructor(data) {
this.name = data.name
this.full_name = data.full_name
this.INN = data.INN
this.KPP = data.KPP
this.OKPO = data.OKPO
this.Jur_address = data.Jur_adress
this.Fact_address = data.Fact_adress
this.Phone = data.Phone
this.bank_account = data.bank_account
this.corr_account = data.corr_account
this.Bank_name = data.Bank_name
this.BIK = data.BIK
this.Bank_address = data.Bank_adress
}
}
/**
* @param {string} message — сообщение
* @param {Profile} data — подробная информация о контрагенте
*/
function parseProfile({ data }) {
return {
message: data.message,
data: new Profile(data.table.tbody),
}
}