mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 02:25:17 +00:00
FR-754: Add payment institution account (#284)
This commit is contained in:
parent
14fe9434f6
commit
219c164e80
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -41,7 +41,7 @@ FR-0,FR-1: <ОБЩЕЕ НАЗВАНИЕ> или <НАЗВАНИЕ 1>; <НАЗВ
|
||||
|
||||
### 🔗 Страницы с изменениями либо как их воспроизвести
|
||||
|
||||
- http://localhost:8000/
|
||||
- http://localhost:7000/
|
||||
|
||||
### 🖼 Скриншоты
|
||||
|
||||
|
@ -8,6 +8,7 @@ enum Type {
|
||||
RussianBankAccount = 'russian_bank_account',
|
||||
InternationalBankAccount = 'international_bank_account',
|
||||
WalletInfo = 'wallet_info',
|
||||
PaymentInstitutionAccount = 'payment_institution_account',
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -23,16 +24,26 @@ export class PayoutToolInfoComponent implements OnInit {
|
||||
|
||||
selected: Type;
|
||||
|
||||
types = [Type.RussianBankAccount, Type.InternationalBankAccount, Type.WalletInfo];
|
||||
types = [
|
||||
Type.RussianBankAccount,
|
||||
Type.InternationalBankAccount,
|
||||
Type.WalletInfo,
|
||||
Type.PaymentInstitutionAccount,
|
||||
];
|
||||
|
||||
t = Type;
|
||||
|
||||
constructor(private fb: FormBuilder) {}
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
const russianBankAccount = get(this, 'initialValue.russian_bank_account', null);
|
||||
const internationalBankAccount = get(this, 'initialValue.international_bank_account', null);
|
||||
const walletInfo = get(this, 'initialValue.wallet_info', null);
|
||||
const paymentInstitutionAccount = get(
|
||||
this,
|
||||
`initialValue.${Type.PaymentInstitutionAccount}`,
|
||||
null
|
||||
);
|
||||
if (russianBankAccount) {
|
||||
this.selected = Type.RussianBankAccount;
|
||||
}
|
||||
@ -42,26 +53,31 @@ export class PayoutToolInfoComponent implements OnInit {
|
||||
if (walletInfo) {
|
||||
this.selected = Type.WalletInfo;
|
||||
}
|
||||
if (paymentInstitutionAccount) {
|
||||
this.selected = Type.PaymentInstitutionAccount;
|
||||
}
|
||||
this.select();
|
||||
this.form.updateValueAndValidity();
|
||||
}
|
||||
|
||||
select() {
|
||||
select(): void {
|
||||
this.clearControl();
|
||||
switch (this.selected) {
|
||||
case Type.RussianBankAccount:
|
||||
this.clearControl();
|
||||
this.form.registerControl(Type.RussianBankAccount, this.fb.group({}));
|
||||
break;
|
||||
case Type.InternationalBankAccount:
|
||||
this.clearControl();
|
||||
this.form.registerControl(Type.InternationalBankAccount, this.fb.group({}));
|
||||
break;
|
||||
case Type.WalletInfo: {
|
||||
this.clearControl();
|
||||
const walletInfo = get(this, 'initialValue.wallet_info', {});
|
||||
this.form.registerControl(Type.WalletInfo, this.fb.group(walletInfo));
|
||||
break;
|
||||
}
|
||||
case Type.PaymentInstitutionAccount:
|
||||
this.form.registerControl(Type.PaymentInstitutionAccount, this.fb.control({}));
|
||||
this.form.patchValue({});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user