;
+
+ constructor(private fb: FormBuilder, private dtm: DomainTypedManager) {}
+
+ ngOnInit() {
+ this.paymentInstitutions$ = this.dtm
+ .getPaymentInstitutions()
+ .pipe(
+ map(paymentInstitutions =>
+ sortBy(paymentInstitutions, paymentInstitution => paymentInstitution.ref.id)
+ )
+ );
+ const paymentInstitutionId = get(this, 'initialValue.id', '');
+ this.form.registerControl(
+ 'id',
+ this.fb.control(paymentInstitutionId, this.required ? Validators.required : null)
+ );
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.html
new file mode 100644
index 00000000..2dccf5f1
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.html
@@ -0,0 +1,40 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts
new file mode 100644
index 00000000..51575476
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts
@@ -0,0 +1,52 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { InternationalBankAccount } from '../../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-international-bank-account',
+ templateUrl: 'international-bank-account.component.html'
+})
+export class InternationalBankAccountComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: InternationalBankAccount;
+
+ isBankDetails = false;
+
+ isCorrespondentAccount = false;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const number = get(this, 'initialValue.number', '');
+ const iban = get(this, 'initialValue.iban', '');
+ this.form.registerControl('number', this.fb.control(number));
+ this.form.registerControl('iban', this.fb.control(iban));
+ const bank = get(this, 'initialValue.bank', null);
+ if (bank) {
+ this.detailsChange(true);
+ }
+ const account = get(this, 'initialValue.correspondent_account', null);
+ if (account) {
+ this.accountChange(true);
+ }
+ this.form.updateValueAndValidity();
+ }
+
+ detailsChange(showDetails: boolean) {
+ this.isBankDetails = showDetails;
+ this.isBankDetails
+ ? this.form.registerControl('bank', this.fb.group({}))
+ : this.form.removeControl('bank');
+ }
+
+ accountChange(showCorrespondentAccount: boolean) {
+ this.isCorrespondentAccount = showCorrespondentAccount;
+ this.isCorrespondentAccount
+ ? this.form.registerControl('correspondent_account', this.fb.group({}))
+ : this.form.removeControl('correspondent_account');
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.html
new file mode 100644
index 00000000..9e4f8959
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.html
@@ -0,0 +1,13 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts
new file mode 100644
index 00000000..60e0277f
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts
@@ -0,0 +1,33 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { InternationalBankDetails } from '../../../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-international-bank-details',
+ templateUrl: 'international-bank-details.component.html'
+})
+export class InternationalBankDetailsComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: InternationalBankDetails;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const control = (data = '') => this.fb.control(data);
+ const bic = get(this, 'initialValue.bic', '');
+ const country = get(this, 'initialValue.country', '');
+ const name = get(this, 'initialValue.name', '');
+ const address = get(this, 'initialValue.address', '');
+ const abaRtn = get(this, 'initialValue.aba_rtn', '');
+ this.form.registerControl('bic', control(bic));
+ this.form.registerControl('country', control(country)); // Residence enum
+ this.form.registerControl('name', control(name));
+ this.form.registerControl('address', control(address));
+ this.form.registerControl('aba_rtn', control(abaRtn));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.html
new file mode 100644
index 00000000..f6cc1d90
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.html
@@ -0,0 +1,25 @@
+
+
+
+ {{ type }}
+
+
+
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.ts
new file mode 100644
index 00000000..e60bf988
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/payout-tool-info.component.ts
@@ -0,0 +1,71 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { PayoutToolInfo } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+enum Type {
+ russian_bank_account = 'russian_bank_account',
+ international_bank_account = 'international_bank_account',
+ wallet_info = 'wallet_info'
+}
+
+@Component({
+ selector: 'cc-payout-tool-info',
+ templateUrl: 'payout-tool-info.component.html'
+})
+export class PayoutToolInfoComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: PayoutToolInfo;
+
+ selected: Type;
+
+ types = [Type.russian_bank_account, Type.international_bank_account, Type.wallet_info];
+
+ t = Type;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ 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);
+ if (russianBankAccount) {
+ this.selected = Type.russian_bank_account;
+ }
+ if (internationalBankAccount) {
+ this.selected = Type.international_bank_account;
+ }
+ if (walletInfo) {
+ this.selected = Type.wallet_info;
+ }
+ this.select();
+ this.form.updateValueAndValidity();
+ }
+
+ select() {
+ switch (this.selected) {
+ case Type.russian_bank_account:
+ this.clearControl();
+ this.form.registerControl(Type.russian_bank_account, this.fb.group({}));
+ break;
+ case Type.international_bank_account:
+ this.clearControl();
+ this.form.registerControl(Type.international_bank_account, this.fb.group({}));
+ break;
+ case Type.wallet_info:
+ this.clearControl();
+ const walletInfo = get(this, 'initialValue.wallet_info', {});
+ this.form.registerControl(Type.wallet_info, this.fb.group(walletInfo));
+ break;
+ }
+ }
+
+ private clearControl() {
+ this.types.forEach(type => {
+ this.form.removeControl(type);
+ });
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.html
new file mode 100644
index 00000000..cb9b0ec3
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.html
@@ -0,0 +1,21 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts
new file mode 100644
index 00000000..0a03f86e
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts
@@ -0,0 +1,31 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import get from 'lodash-es/get';
+import { RussianBankAccount } from '../../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-russian-bank-account',
+ templateUrl: 'russian-bank-account.component.html'
+})
+export class RussianBankAccountComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: RussianBankAccount;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const control = value => this.fb.control(value, Validators.required);
+ const account = get(this, 'initialValue.account', '');
+ const bankName = get(this, 'initialValue.bank_name', '');
+ const bankPostAccount = get(this, 'initialValue.bank_post_account', '');
+ const bankBik = get(this, 'initialValue.bank_bik', '');
+ this.form.registerControl('account', control(account));
+ this.form.registerControl('bank_name', control(bankName));
+ this.form.registerControl('bank_post_account', control(bankPostAccount));
+ this.form.registerControl('bank_bik', control(bankBik));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.html
new file mode 100644
index 00000000..f3557715
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.html
@@ -0,0 +1,7 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.ts
new file mode 100644
index 00000000..c006f25d
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-info/wallet-info/wallet-info.component.ts
@@ -0,0 +1,18 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+
+@Component({
+ selector: 'cc-wallet-info',
+ templateUrl: 'wallet-info.component.html'
+})
+export class WalletInfoComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ this.form.registerControl('wallet_id', this.fb.control(''));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.html
new file mode 100644
index 00000000..c66b3345
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.html
@@ -0,0 +1,18 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts
new file mode 100644
index 00000000..abaf457f
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts
@@ -0,0 +1,33 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import * as uuid from 'uuid/v4';
+import get from 'lodash-es/get';
+import { PayoutToolModificationUnit } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-contract-payout-tool-modification-unit',
+ templateUrl: 'payout-tool-modification-unit.component.html'
+})
+export class PayoutToolModificationUnitComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: PayoutToolModificationUnit;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const payoutToolId = get(this, 'initialValue.payout_tool_id', '');
+ this.form.registerControl(
+ 'payout_tool_id',
+ this.fb.control(payoutToolId, Validators.required)
+ );
+ this.form.registerControl('modification', this.fb.group({}));
+ this.form.updateValueAndValidity();
+ }
+
+ generate() {
+ this.form.patchValue({ payout_tool_id: uuid() });
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.html
new file mode 100644
index 00000000..4b654ac4
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.html
@@ -0,0 +1,23 @@
+
+
+
+ {{ type }}
+
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.ts
new file mode 100644
index 00000000..3b267b96
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-modification/payout-tool-modification.component.ts
@@ -0,0 +1,55 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { PayoutToolModification } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+enum Type {
+ creation = 'creation',
+ info_modification = 'info_modification'
+}
+
+@Component({
+ selector: 'cc-contract-payout-tool-modification',
+ templateUrl: 'payout-tool-modification.component.html'
+})
+export class PayoutToolModificationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: PayoutToolModification;
+
+ types = [Type.creation, Type.info_modification];
+
+ selected: Type;
+
+ t = Type;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const creation = get(this, 'initialValue.creation', '');
+ const infoModification = get(this, 'initialValue.info_modification', '');
+ if (creation) {
+ this.selected = Type.creation;
+ }
+ if (infoModification) {
+ this.selected = Type.info_modification;
+ }
+ this.select();
+ this.form.updateValueAndValidity();
+ }
+
+ select() {
+ switch (this.selected) {
+ case Type.creation:
+ this.form.registerControl(Type.creation, this.fb.group({}));
+ this.form.removeControl(Type.info_modification);
+ break;
+ case Type.info_modification:
+ this.form.registerControl(Type.info_modification, this.fb.group({}));
+ this.form.removeControl(Type.creation);
+ break;
+ }
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.html
new file mode 100644
index 00000000..aef72c78
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.html
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.ts
new file mode 100644
index 00000000..e01f9af9
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/payout-tool-params/payout-tool-params.component.ts
@@ -0,0 +1,23 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { PayoutToolInfo } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-payout-tool-params',
+ templateUrl: 'payout-tool-params.component.html'
+})
+export class PayoutToolParamsComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: PayoutToolInfo;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ this.form.registerControl('currency', this.fb.group({}));
+ this.form.registerControl('tool_info', this.fb.group({}));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.html
new file mode 100644
index 00000000..eee8f4cf
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.html
@@ -0,0 +1,19 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.ts
new file mode 100644
index 00000000..e069d7c7
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/report-preferences/report-preferences.component.ts
@@ -0,0 +1,58 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { ReportPreferences } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-report-preferences',
+ templateUrl: 'report-preferences.component.html'
+})
+export class ReportPreferencesComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ReportPreferences;
+
+ showPreferences = false;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ this.togglePreferences();
+ this.form.updateValueAndValidity();
+ }
+
+ toggleCheckbox(show: boolean, controlName: string, data = {}) {
+ if (show) {
+ this.form.registerControl(
+ controlName,
+ this.fb.group(this.getFormGroup(controlName, data))
+ );
+ } else {
+ this.form.removeControl(controlName);
+ }
+ }
+
+ togglePreferences() {
+ const preferences = get(this, 'initialValue.service_acceptance_act_preferences', null);
+ this.showPreferences = preferences !== null;
+ this.toggleCheckbox(
+ this.showPreferences,
+ 'service_acceptance_act_preferences',
+ preferences
+ );
+ }
+
+ private getFormGroup(type: string, data) {
+ switch (type) {
+ case 'service_acceptance_act_preferences':
+ return {
+ schedule: this.fb.group(data.schedule || {}),
+ signer: this.fb.group({})
+ };
+ default:
+ return {};
+ }
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.html
new file mode 100644
index 00000000..3ea761ec
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.html
@@ -0,0 +1,17 @@
+
+
+
+ {{ type }}
+
+
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.ts
new file mode 100644
index 00000000..fc7f536d
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative-document/representative-document.component.ts
@@ -0,0 +1,56 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { RepresentativeDocument } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+enum Type {
+ articlesOfAssociation = 'articles_of_association',
+ powerOfAttorney = 'power_of_attorney'
+}
+
+@Component({
+ selector: 'cc-representative-document',
+ templateUrl: 'representative-document.component.html'
+})
+export class RepresentativeDocumentComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: RepresentativeDocument;
+
+ selected: Type;
+
+ types = [Type.articlesOfAssociation, Type.powerOfAttorney];
+
+ t = Type;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const articlesOfAssociation = get(this, 'initialValue.articles_of_association', null);
+ const powerOfAttorney = get(this, 'initialValue.power_of_attorney', null);
+ if (articlesOfAssociation) {
+ this.selected = Type.articlesOfAssociation;
+ this.select(articlesOfAssociation);
+ }
+ if (powerOfAttorney) {
+ this.selected = Type.powerOfAttorney;
+ this.select(powerOfAttorney);
+ }
+ this.form.updateValueAndValidity();
+ }
+
+ select(data = {}) {
+ switch (this.selected) {
+ case Type.articlesOfAssociation:
+ this.form.registerControl(Type.articlesOfAssociation, this.fb.group(data));
+ this.form.removeControl(Type.powerOfAttorney);
+ break;
+ case Type.powerOfAttorney:
+ this.form.registerControl(Type.powerOfAttorney, this.fb.group(data));
+ this.form.removeControl(Type.articlesOfAssociation);
+ break;
+ }
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.html
new file mode 100644
index 00000000..53757d38
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.html
@@ -0,0 +1,13 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.ts
new file mode 100644
index 00000000..c9e7eab7
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/representative/representative.component.ts
@@ -0,0 +1,27 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import get from 'lodash-es/get';
+import { Representative } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-representative',
+ templateUrl: 'representative.component.html'
+})
+export class RepresentativeComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: Representative;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const position = get(this, 'initialValue.position', '');
+ const fullName = get(this, 'initialValue.full_name', '');
+ this.form.registerControl('position', this.fb.control(position, Validators.required));
+ this.form.registerControl('full_name', this.fb.control(fullName, Validators.required));
+ this.form.registerControl('document', this.fb.group({}));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.html
new file mode 100644
index 00000000..700a4fe6
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.html
@@ -0,0 +1,5 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.ts
new file mode 100644
index 00000000..1bbab505
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/contract/termination/termination.component.ts
@@ -0,0 +1,24 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import get from 'lodash-es/get';
+import { ContractTermination } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-termination',
+ templateUrl: 'termination.component.html'
+})
+export class TerminationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ContractTermination;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const reason = get(this, 'initialValue.reason', '');
+ this.form.registerControl('reason', this.fb.control(reason));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.html
new file mode 100644
index 00000000..db4671f0
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.html
@@ -0,0 +1,5 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.ts
new file mode 100644
index 00000000..a899b0db
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/currency-ref/currency-ref.component.ts
@@ -0,0 +1,18 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+
+@Component({
+ selector: 'cc-currency-ref',
+ templateUrl: 'currency-ref.component.html'
+})
+export class CurrencyRefComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ this.form.registerControl('symbolic_code', this.fb.control('RUB', Validators.required));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/filter-empty-string-value.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/filter-empty-string-value.ts
new file mode 100644
index 00000000..6560d845
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/filter-empty-string-value.ts
@@ -0,0 +1,42 @@
+import isDate from 'lodash-es/isDate';
+import isArray from 'lodash-es/isArray';
+import isObject from 'lodash-es/isObject';
+import reduce from 'lodash-es/reduce';
+import * as moment from 'moment';
+
+type Filter = (value: any) => boolean;
+
+function filterObject(object: object, filter: Filter): object {
+ return reduce(
+ object,
+ (result, value, key) => {
+ if (filter(value)) {
+ return {
+ ...result,
+ [key]: filterValues(value, filter)
+ };
+ }
+ return result;
+ },
+ {}
+ );
+}
+
+export function filterValues(value: any, filter: Filter): any {
+ if (isDate(value)) {
+ return value;
+ }
+ if (moment.isMoment(value)) {
+ return value.toISOString();
+ }
+ if (isArray(value)) {
+ console.error('Array is not supported', value);
+ return value;
+ }
+ if (isObject(value)) {
+ return filterObject(value, filter);
+ }
+ return value;
+}
+
+export const filterEmptyStringValues = (value: any) => filterValues(value, v => v !== '');
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.html
new file mode 100644
index 00000000..e4820dde
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.html
@@ -0,0 +1,4 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.ts
new file mode 100644
index 00000000..4531279e
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/form-wrapper/form-wrapper.component.ts
@@ -0,0 +1,10 @@
+import { Component, Input } from '@angular/core';
+
+@Component({
+ selector: 'cc-form-wrapper',
+ templateUrl: 'form-wrapper.component.html'
+})
+export class FormWrapperComponent {
+ @Input()
+ name: string;
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/index.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/index.ts
new file mode 100644
index 00000000..2caaa341
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/index.ts
@@ -0,0 +1 @@
+export * from './party-modification-creation.module';
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.html
new file mode 100644
index 00000000..8afdc776
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.html
@@ -0,0 +1,10 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.ts
new file mode 100644
index 00000000..4c8e6c1a
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/nested-form-wrapper/nested-form-wrapper.component.ts
@@ -0,0 +1,10 @@
+import { Component, Input } from '@angular/core';
+
+@Component({
+ selector: 'cc-nested-form-wrapper',
+ templateUrl: 'nested-form-wrapper.component.html'
+})
+export class NestedFormWrapperComponent {
+ @Input()
+ caption: string;
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.html
new file mode 100644
index 00000000..ef331181
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.html
@@ -0,0 +1,98 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.ts
new file mode 100644
index 00000000..2e74981d
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.component.ts
@@ -0,0 +1,74 @@
+import {
+ Component,
+ EventEmitter,
+ Input,
+ OnChanges,
+ OnInit,
+ Output,
+ SimpleChanges
+} from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import * as uuid from 'uuid/v4';
+
+import { toPartyModification } from './to-party-modification';
+import { filterEmptyStringValues } from './filter-empty-string-value';
+import { ActionType, ModificationAction } from '../modification-action';
+import {
+ ContractModification,
+ PartyModification,
+ ShopModification
+} from '../../../../thrift-services/damsel/gen-model/claim_management';
+import { ShopModificationName } from '../shop-modification-name';
+import { ContractModificationName } from '../contract-modification-name';
+
+@Component({
+ selector: 'cc-party-modification-creation',
+ templateUrl: 'party-modification-creation.component.html'
+})
+export class PartyModificationCreationComponent implements OnInit, OnChanges {
+ @Input()
+ action: ModificationAction;
+
+ @Input()
+ modification: ShopModification | ContractModification;
+
+ @Output()
+ valueChanges: EventEmitter = new EventEmitter();
+
+ @Output()
+ statusChanges: EventEmitter<'VALID' | 'INVALID'> = new EventEmitter();
+
+ actionTypes = ActionType;
+ shopModificationNames = ShopModificationName;
+ contractModificationNames = ContractModificationName;
+
+ form: FormGroup;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ this.form = this.fb.group({
+ unitID: [
+ {
+ value: uuid(),
+ disabled: true
+ },
+ Validators.required
+ ],
+ modification: this.fb.group({})
+ });
+ this.form.statusChanges.subscribe(status => this.statusChanges.emit(status));
+ this.form.valueChanges.subscribe(() => {
+ const filtered = filterEmptyStringValues(this.form.getRawValue());
+ const modification = toPartyModification(this.action, filtered);
+ this.valueChanges.emit(modification);
+ });
+ }
+
+ ngOnChanges(changes: SimpleChanges) {
+ const { unitID } = changes;
+ if (unitID && !unitID.firstChange) {
+ this.form.patchValue({ unitID: unitID.currentValue });
+ }
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.module.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.module.ts
new file mode 100644
index 00000000..983bf6f8
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/party-modification-creation.module.ts
@@ -0,0 +1,116 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import {
+ MatButtonModule,
+ MatCheckboxModule,
+ MatDatepickerModule,
+ MatDividerModule,
+ MatIconModule,
+ MatInputModule,
+ MatProgressBarModule,
+ MatRadioModule,
+ MatSelectModule,
+ MatSnackBarModule
+} from '@angular/material';
+import { FlexLayoutModule } from '@angular/flex-layout';
+import { ReactiveFormsModule } from '@angular/forms';
+
+import { PartyModificationCreationComponent } from './party-modification-creation.component';
+import { PayoutToolModificationUnitComponent } from './contract/payout-tool-modification-unit/payout-tool-modification-unit.component';
+import { PayoutToolModificationComponent } from './contract/payout-tool-modification/payout-tool-modification.component';
+import { PayoutToolParamsComponent } from './contract/payout-tool-params/payout-tool-params.component';
+import { CurrencyRefComponent } from './currency-ref/currency-ref.component';
+import { PayoutToolInfoComponent } from './contract/payout-tool-info/payout-tool-info.component';
+import { RussianBankAccountComponent } from './contract/payout-tool-info/russian-bank-account/russian-bank-account.component';
+import { InternationalBankAccountComponent } from './contract/payout-tool-info/international-bank-account/international-bank-account.component';
+import { InternationalBankDetailsComponent } from './contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component';
+import { LegalAgreementBindingComponent } from './contract/legal-agreement-binding/legal-agreement-binding.component';
+import { AdjustmentModificationUnitComponent } from './contract/adjustment-modification-unit/adjustment-modification-unit.component';
+import { ReportPreferencesComponent } from './contract/report-preferences/report-preferences.component';
+import { CategoryRefComponent } from './shop/category-ref/category-ref.component';
+import { ShopDetailsComponent } from './shop/shop-details/shop-details.component';
+import { ShopLocationComponent } from './shop/location-modification/shop-location.component';
+import { ShopAccountCreationComponent } from './shop/shop-account-creation/shop-account-creation.component';
+import { ShopPayoutScheduleModificationComponent } from './shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component';
+import { AdjustmentModificationComponent } from './contract/adjustment-modification/adjustment-modification.component';
+import { BusinessScheduleRefComponent } from './business-schedule-ref/business-schedule-ref.component';
+import { BusinessScheduleSelectorComponent } from './business-schedule-ref/business-schedule-selector/business-schedule-selector.component';
+import { RepresentativeComponent } from './contract/representative/representative.component';
+import { AdjustmentParamsComponent } from './contract/adjustment-params/adjustment-params.component';
+import { RepresentativeDocumentComponent } from './contract/representative-document/representative-document.component';
+import { ContractTemplateRefComponent } from './contract/contract-template-ref/contract-template-ref.component';
+import { ContractModificationComponent } from './shop/contract-modification/contract-modification.component';
+import { PayoutToolModificationComponent as ShopPayoutToolModificationComponent } from './shop/payout-tool-modification/payout-tool-modification.component';
+import { ShopParamsComponent } from './shop/shop-params/shop-params.component';
+import { TerminationComponent } from './contract/termination/termination.component';
+import { ContractorIdComponent } from './contract/contractor-id/contractor-id.component';
+import { PaymentInstitutionRefComponent } from './contract/payment-institution/payment-institution-ref.component';
+import { ContractParamsComponent } from './contract/contract-params/contract-params.component';
+import { ContractorComponent } from './contract/contractor/contractor.component';
+import { LegalEntityComponent } from './contract/legal-entity/legal-entity.component';
+import { RussianLegalEntityComponent } from './contract/legal-entity/russian-legal-entity/russian-legal-entity.component';
+import { InternationalLegalEntityComponent } from './contract/legal-entity/international-legal-entity/international-legal-entity.component';
+import { NestedFormWrapperComponent } from './nested-form-wrapper/nested-form-wrapper.component';
+import { FormWrapperComponent } from './form-wrapper/form-wrapper.component';
+import { WalletInfoComponent } from './contract/payout-tool-info/wallet-info/wallet-info.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ReactiveFormsModule,
+ FlexLayoutModule,
+ MatButtonModule,
+ MatInputModule,
+ MatDatepickerModule,
+ MatSelectModule,
+ MatRadioModule,
+ MatCheckboxModule,
+ MatIconModule,
+ MatDividerModule,
+ MatSnackBarModule,
+ MatProgressBarModule
+ ],
+ declarations: [
+ PartyModificationCreationComponent,
+ PayoutToolModificationUnitComponent,
+ PayoutToolModificationComponent,
+ PayoutToolParamsComponent,
+ CurrencyRefComponent,
+ PayoutToolInfoComponent,
+ RussianBankAccountComponent,
+ WalletInfoComponent,
+ InternationalBankAccountComponent,
+ InternationalBankDetailsComponent,
+ WalletInfoComponent,
+ LegalAgreementBindingComponent,
+ AdjustmentModificationUnitComponent,
+ ReportPreferencesComponent,
+ CategoryRefComponent,
+ ShopDetailsComponent,
+ ShopLocationComponent,
+ ShopAccountCreationComponent,
+ ShopPayoutScheduleModificationComponent,
+ AdjustmentModificationComponent,
+ BusinessScheduleRefComponent,
+ RepresentativeComponent,
+ AdjustmentParamsComponent,
+ RepresentativeDocumentComponent,
+ ContractTemplateRefComponent,
+ ContractModificationComponent,
+ ShopPayoutToolModificationComponent,
+ ShopParamsComponent,
+ TerminationComponent,
+ ContractorIdComponent,
+ PaymentInstitutionRefComponent,
+ ContractParamsComponent,
+ ContractorComponent,
+ LegalEntityComponent,
+ RussianLegalEntityComponent,
+ InternationalLegalEntityComponent,
+ NestedFormWrapperComponent,
+ FormWrapperComponent,
+ BusinessScheduleSelectorComponent
+ ],
+ exports: [PartyModificationCreationComponent]
+})
+export class PartyModificationCreationModule {}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.html
new file mode 100644
index 00000000..eacb9f90
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.html
@@ -0,0 +1,14 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.ts
new file mode 100644
index 00000000..a6b01447
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/category-ref/category-ref.component.ts
@@ -0,0 +1,62 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { MatSnackBar } from '@angular/material';
+import { Observable } from 'rxjs';
+import { map, tap } from 'rxjs/internal/operators';
+import sortBy from 'lodash-es/sortBy';
+import { get } from 'lodash-es';
+import { Category, CategoryRef } from '../../../../../../thrift-services/damsel/gen-model/domain';
+import { CategoryService } from '../../../../../../papi/category.service';
+
+@Component({
+ selector: 'cc-category-ref',
+ templateUrl: 'category-ref.component.html'
+})
+export class CategoryRefComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ required: boolean;
+
+ @Input()
+ initialValue: CategoryRef;
+
+ categories$: Observable;
+
+ isLoading = true;
+
+ constructor(
+ private categoryService: CategoryService,
+ private fb: FormBuilder,
+ private snackBar: MatSnackBar
+ ) {}
+
+ ngOnInit() {
+ const category = get(this, 'initialValue.id', '');
+ this.form.registerControl(
+ 'id',
+ this.fb.control(
+ {
+ value: category,
+ disabled: category.length === 0
+ },
+ this.required ? Validators.required : null
+ )
+ );
+ this.categories$ = this.categoryService.getCategories().pipe(
+ map(categories => sortBy(categories, 'id')),
+ tap(
+ () => {
+ this.form.controls.id.enable();
+ this.isLoading = false;
+ },
+ () => {
+ this.isLoading = false;
+ this.snackBar.open('An error occurred while shop category receiving', 'OK');
+ }
+ )
+ );
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.html
new file mode 100644
index 00000000..731b9159
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.html
@@ -0,0 +1,8 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.ts
new file mode 100644
index 00000000..e8644b01
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/contract-modification/contract-modification.component.ts
@@ -0,0 +1,29 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ShopContractModification } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-shop-contract-modification',
+ templateUrl: 'contract-modification.component.html'
+})
+export class ContractModificationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ShopContractModification;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const contractId = get(this, 'initialValue.contract_id', '');
+ const payoutToolId = get(this, 'initialValue.payout_tool_id', '');
+ this.form.registerControl('contract_id', this.fb.control(contractId, Validators.required));
+ this.form.registerControl(
+ 'payout_tool_id',
+ this.fb.control(payoutToolId, Validators.required)
+ );
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.html
new file mode 100644
index 00000000..29109807
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.html
@@ -0,0 +1,7 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.ts
new file mode 100644
index 00000000..eae17cba
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/location-modification/shop-location.component.ts
@@ -0,0 +1,24 @@
+import { Component, Input, OnChanges } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ShopLocation } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-shop-location',
+ templateUrl: 'shop-location.component.html'
+})
+export class ShopLocationComponent implements OnChanges {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ShopLocation;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnChanges() {
+ const url = get(this.initialValue, 'url', '');
+ this.form.registerControl('url', this.fb.control(url));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.html
new file mode 100644
index 00000000..8b144ddd
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.html
@@ -0,0 +1,5 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.ts
new file mode 100644
index 00000000..91815e1e
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/payout-tool-modification/payout-tool-modification.component.ts
@@ -0,0 +1,24 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { get } from 'lodash-es';
+import { PayoutToolID } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-shop-payout-tool-modification',
+ templateUrl: 'payout-tool-modification.component.html'
+})
+export class PayoutToolModificationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: PayoutToolID;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const payoutToolId = get(this, 'initialValue.modification', '');
+ this.form.setControl('modification', this.fb.control(payoutToolId, Validators.required));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.html
new file mode 100644
index 00000000..958b0209
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.ts
new file mode 100644
index 00000000..15bd6562
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-account-creation/shop-account-creation.component.ts
@@ -0,0 +1,24 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ShopAccountParams } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-shop-account-creation',
+ templateUrl: 'shop-account-creation.component.html'
+})
+export class ShopAccountCreationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ShopAccountParams;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const currency = get(this, 'initialValue.currency', '');
+ this.form.registerControl('currency', this.fb.group(currency));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.html
new file mode 100644
index 00000000..9c2ac2dd
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.html
@@ -0,0 +1,10 @@
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.ts
new file mode 100644
index 00000000..3040b920
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-details/shop-details.component.ts
@@ -0,0 +1,26 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ShopDetails } from '../../../../../../thrift-services/damsel/gen-model/domain';
+
+@Component({
+ selector: 'cc-shop-details',
+ templateUrl: 'shop-details.component.html'
+})
+export class ShopDetailsComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ShopDetails;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const name = get(this.initialValue, 'name', '');
+ const description = get(this.initialValue, 'description', '');
+ this.form.registerControl('name', this.fb.control(name, Validators.required));
+ this.form.registerControl('description', this.fb.control(description));
+ this.form.updateValueAndValidity();
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.html
new file mode 100644
index 00000000..8c58bfcb
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.html
@@ -0,0 +1,30 @@
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.ts
new file mode 100644
index 00000000..23db3ae9
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-params/shop-params.component.ts
@@ -0,0 +1,48 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ShopParams } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-shop-params',
+ templateUrl: 'shop-params.component.html'
+})
+export class ShopParamsComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ShopParams;
+
+ showCategory = false;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ const contractId = get(this, 'initialValue.contract_id', '');
+ const payoutToolId = get(this, 'initialValue.payout_tool_id', '');
+ this.form.registerControl('contract_id', this.fb.control(contractId, Validators.required));
+ this.form.registerControl(
+ 'payout_tool_id',
+ this.fb.control(payoutToolId, Validators.required)
+ );
+ this.form.registerControl('details', this.fb.group({}));
+ this.form.registerControl('location', this.fb.group({}));
+ this.toggleCategory();
+ this.form.updateValueAndValidity();
+ }
+
+ toggleCheckbox(show: boolean, controlName: string, data: object = {}) {
+ if (show) {
+ this.form.registerControl(controlName, this.fb.group(data));
+ } else {
+ this.form.removeControl(controlName);
+ }
+ }
+
+ toggleCategory() {
+ const category = get(this, 'initialValue.category', null);
+ this.showCategory = category !== null;
+ this.toggleCheckbox(this.showCategory, 'category', category);
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.html b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.html
new file mode 100644
index 00000000..0f229047
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.html
@@ -0,0 +1,10 @@
+
+ Schedule
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts
new file mode 100644
index 00000000..25a85f61
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts
@@ -0,0 +1,45 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { get } from 'lodash-es';
+import { ScheduleModification } from '../../../../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-shop-schedule-modification',
+ templateUrl: 'shop-payout-schedule-modification.component.html'
+})
+export class ShopPayoutScheduleModificationComponent implements OnInit {
+ @Input()
+ form: FormGroup;
+
+ @Input()
+ initialValue: ScheduleModification;
+
+ showSchedule = false;
+
+ constructor(private fb: FormBuilder) {}
+
+ ngOnInit() {
+ setTimeout(() => {
+ this.toggleSchedule();
+ this.form.updateValueAndValidity();
+ });
+ }
+
+ toggleCheckbox(e, data) {
+ if (e.checked) {
+ this.form.registerControl(data, this.fb.group({}));
+ } else {
+ this.form.removeControl(data);
+ }
+ }
+
+ toggleSchedule() {
+ const schedule = get(this, 'initialValue.schedule', null);
+ this.showSchedule = schedule !== null;
+ if (this.showSchedule) {
+ this.form.registerControl('schedule', this.fb.group(schedule));
+ } else {
+ this.form.removeControl('schedule');
+ }
+ }
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/to-party-modification.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/to-party-modification.ts
new file mode 100644
index 00000000..67689862
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/to-party-modification.ts
@@ -0,0 +1,30 @@
+import { UnitName } from './unit-name';
+import { ShopModificationName } from '../shop-modification-name';
+import { ContractModificationName } from '../contract-modification-name';
+import { ActionType, ModificationAction } from '../modification-action';
+
+const toModification = (
+ unitID: string,
+ modification: any,
+ unitName: UnitName,
+ modificationName: ShopModificationName | ContractModificationName
+) => ({
+ [unitName]: {
+ id: unitID,
+ modification: {
+ [modificationName]: modification
+ }
+ }
+});
+
+export const toPartyModification = (action: ModificationAction, formValue: any) => {
+ const { unitID, modification } = formValue;
+ const toMod = toModification.bind(null, unitID, modification);
+ const { type, name } = action;
+ switch (type) {
+ case ActionType.shopAction:
+ return toMod(UnitName.shopModification, name);
+ case ActionType.contractAction:
+ return toMod(UnitName.contractModification, name);
+ }
+};
diff --git a/src/app/claim-mgt/claim/party-modification-creator/creation/unit-name.ts b/src/app/claim-mgt/claim/party-modification-creator/creation/unit-name.ts
new file mode 100644
index 00000000..0bd744c8
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/creation/unit-name.ts
@@ -0,0 +1,4 @@
+export enum UnitName {
+ shopModification = 'shop_modification',
+ contractModification = 'contract_modification'
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/modification-action.ts b/src/app/claim-mgt/claim/party-modification-creator/modification-action.ts
new file mode 100644
index 00000000..c3e24c33
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/modification-action.ts
@@ -0,0 +1,12 @@
+import { ContractModificationName } from './contract-modification-name';
+import { ShopModificationName } from './shop-modification-name';
+
+export enum ActionType {
+ contractAction = 'contractAction',
+ shopAction = 'shopAction'
+}
+
+export interface ModificationAction {
+ type: ActionType;
+ name?: ContractModificationName | ShopModificationName;
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/shop-modification-name.ts b/src/app/claim-mgt/claim/party-modification-creator/shop-modification-name.ts
new file mode 100644
index 00000000..1e7a38a1
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/shop-modification-name.ts
@@ -0,0 +1,11 @@
+export enum ShopModificationName {
+ creation = 'creation',
+ categoryModification = 'category_modification',
+ detailsModification = 'details_modification',
+ contractModification = 'contract_modification',
+ payoutToolModification = 'payout_tool_modification',
+ locationModification = 'location_modification',
+ shopAccountCreation = 'shop_account_creation',
+ payoutScheduleModification = 'payout_schedule_modification',
+ unknown = 'unknown'
+}
diff --git a/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.html b/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.html
new file mode 100644
index 00000000..051be721
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.ts b/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.ts
new file mode 100644
index 00000000..d9b61829
--- /dev/null
+++ b/src/app/claim-mgt/claim/party-modification-creator/unit-actions/unit-actions.component.ts
@@ -0,0 +1,87 @@
+import { Component, Inject, OnInit } from '@angular/core';
+import { MAT_BOTTOM_SHEET_DATA, MatBottomSheetRef, MatDialog } from '@angular/material';
+import { ContractModificationName } from '../contract-modification-name';
+import { ShopModificationName } from '../shop-modification-name';
+import { ActionType } from '../modification-action';
+import { ClaimID } from '../../../../thrift-services/damsel/gen-model/claim_management';
+import { CreateModificationComponent } from '../create-modification.component';
+
+interface UnitActionData {
+ type: 'allActions' | 'contractActions' | 'shopActions';
+ claimID: ClaimID;
+ partyID: string;
+}
+
+@Component({
+ templateUrl: 'unit-actions.component.html'
+})
+export class UnitActionsComponent implements OnInit {
+ constructor(
+ private bottomSheetRef: MatBottomSheetRef,
+ private dialog: MatDialog,
+ @Inject(MAT_BOTTOM_SHEET_DATA) public data: UnitActionData
+ ) {}
+
+ contractActions = {
+ type: ActionType.contractAction,
+ visible: false,
+ names: [
+ ContractModificationName.legalAgreementBinding,
+ ContractModificationName.reportPreferencesModification,
+ ContractModificationName.adjustmentModification,
+ ContractModificationName.payoutToolModification,
+ ContractModificationName.termination
+ // ContractModificationName.contractorModification
+ ]
+ };
+
+ shopActions = {
+ type: ActionType.shopAction,
+ visible: false,
+ names: [
+ ShopModificationName.detailsModification,
+ ShopModificationName.locationModification,
+ ShopModificationName.categoryModification,
+ ShopModificationName.shopAccountCreation,
+ ShopModificationName.payoutScheduleModification,
+ ShopModificationName.payoutToolModification,
+ ShopModificationName.contractModification
+ ]
+ };
+
+ ngOnInit() {
+ switch (this.data.type) {
+ case 'allActions':
+ this.contractActions.visible = true;
+ this.shopActions.visible = true;
+ this.contractActions.names = [
+ ContractModificationName.creation,
+ ...this.contractActions.names
+ ];
+ this.shopActions.names = [ShopModificationName.creation, ...this.shopActions.names];
+ break;
+ case 'contractActions':
+ this.contractActions.visible = true;
+ break;
+ case 'shopActions':
+ this.shopActions.visible = true;
+ }
+ }
+
+ select(type: ActionType, name: ContractModificationName | ShopModificationName) {
+ this.bottomSheetRef.dismiss();
+ const config = {
+ data: {
+ action: {
+ type,
+ name
+ },
+ claimID: this.data.claimID,
+ partyID: this.data.partyID
+ },
+ width: '800px',
+ disableClose: true
+ };
+ this.dialog.open(CreateModificationComponent, config);
+ }
+}
diff --git a/src/app/claim-mgt/claim/status-changer/get-available-claim-statuses.ts b/src/app/claim-mgt/claim/status-changer/get-available-claim-statuses.ts
new file mode 100644
index 00000000..92a51fb9
--- /dev/null
+++ b/src/app/claim-mgt/claim/status-changer/get-available-claim-statuses.ts
@@ -0,0 +1,25 @@
+import { ClaimStatus } from '../../../thrift-services/damsel/gen-model/claim_management';
+import { ClaimStatus as ClaimStatusEnum } from '../../../papi/model';
+import { ClaimStatuses } from '../claim-statuses';
+import { extractClaimStatus } from '../../../shared/extract-claim-status';
+
+export const getAvailableClaimStatuses = (status: ClaimStatus): ClaimStatuses[] => {
+ switch (extractClaimStatus(status)) {
+ case ClaimStatusEnum.pending:
+ return [
+ ClaimStatuses.pending_acceptance,
+ ClaimStatuses.review,
+ ClaimStatuses.denied,
+ ClaimStatuses.revoked
+ ];
+ case ClaimStatusEnum.review:
+ return [
+ ClaimStatuses.pending_acceptance,
+ ClaimStatuses.pending,
+ ClaimStatuses.denied,
+ ClaimStatuses.revoked
+ ];
+ default:
+ return [];
+ }
+};
diff --git a/src/app/claim-mgt/claim/status-changer/status-changer.component.html b/src/app/claim-mgt/claim/status-changer/status-changer.component.html
new file mode 100644
index 00000000..ca62e978
--- /dev/null
+++ b/src/app/claim-mgt/claim/status-changer/status-changer.component.html
@@ -0,0 +1,27 @@
+Change claim status
+
+
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claim/status-changer/status-changer.component.scss b/src/app/claim-mgt/claim/status-changer/status-changer.component.scss
new file mode 100644
index 00000000..f4d336fd
--- /dev/null
+++ b/src/app/claim-mgt/claim/status-changer/status-changer.component.scss
@@ -0,0 +1,3 @@
+.hidden {
+ display: none;
+}
diff --git a/src/app/claim-mgt/claim/status-changer/status-changer.component.ts b/src/app/claim-mgt/claim/status-changer/status-changer.component.ts
new file mode 100644
index 00000000..52531459
--- /dev/null
+++ b/src/app/claim-mgt/claim/status-changer/status-changer.component.ts
@@ -0,0 +1,45 @@
+import { Component, Inject, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
+
+import { StatusChangerService } from './status-changer.service';
+import { ClaimID, ClaimStatus } from '../../../thrift-services/damsel/gen-model/claim_management';
+import { ClaimStatuses } from '../claim-statuses';
+import { getAvailableClaimStatuses } from './get-available-claim-statuses';
+
+interface ActionsInterface {
+ partyID: string;
+ claimID: ClaimID;
+ claimStatus: ClaimStatus;
+}
+
+@Component({
+ templateUrl: 'status-changer.component.html',
+ providers: [StatusChangerService],
+ styleUrls: ['status-changer.component.scss']
+})
+export class StatusChangerComponent implements OnInit {
+ actions = getAvailableClaimStatuses(this.data.claimStatus);
+ form = this.actionsService.form;
+ isLoading$ = this.actionsService.isLoading$;
+
+ constructor(
+ private dialogRef: MatDialogRef,
+ private actionsService: StatusChangerService,
+ @Inject(MAT_DIALOG_DATA) private data: ActionsInterface
+ ) {}
+
+ confirm() {
+ this.actionsService.updateClaim(this.data.partyID, this.data.claimID);
+ }
+
+ isReasonVisible(): boolean {
+ const { type } = this.form.getRawValue();
+ return type === ClaimStatuses.denied || type === ClaimStatuses.revoked;
+ }
+
+ ngOnInit(): void {
+ this.actionsService.claim$.subscribe(_ => {
+ this.dialogRef.close(true);
+ });
+ }
+}
diff --git a/src/app/claim-mgt/claim/status-changer/status-changer.service.ts b/src/app/claim-mgt/claim/status-changer/status-changer.service.ts
new file mode 100644
index 00000000..ad001be2
--- /dev/null
+++ b/src/app/claim-mgt/claim/status-changer/status-changer.service.ts
@@ -0,0 +1,112 @@
+import { Injectable } from '@angular/core';
+import { FormBuilder, Validators } from '@angular/forms';
+import { ConnectableObservable, Observable, Subject } from 'rxjs';
+import {
+ catchError,
+ distinctUntilChanged,
+ filter,
+ pairwise,
+ pluck,
+ publish,
+ shareReplay,
+ switchMap
+} from 'rxjs/operators';
+import { MatSnackBar } from '@angular/material/snack-bar';
+import { progress } from '@rbkmoney/partial-fetcher/dist/progress';
+
+import { ClaimID } from '../../../thrift-services/damsel/gen-model/claim_management';
+import { ClaimManagementService } from '../../../thrift-services/damsel/claim-management.service';
+import { ClaimStatuses } from '../claim-statuses';
+
+class UpdateClaim {
+ partyID: string;
+ claimID: ClaimID;
+ action: ClaimStatuses;
+}
+
+@Injectable()
+export class StatusChangerService {
+ private updateClaim$ = new Subject();
+
+ form = this.initForm();
+
+ claim$: Observable = this.updateClaim$.pipe(
+ switchMap(({ partyID, claimID, action }) => {
+ switch (action) {
+ case ClaimStatuses.denied:
+ return this.claimManagementService
+ .denyClaim(partyID, claimID, this.form.getRawValue().reason)
+ .pipe(catchError(e => this.handleError(e)));
+ case ClaimStatuses.pending:
+ return this.claimManagementService
+ .requestClaimChanges(partyID, claimID)
+ .pipe(catchError(e => this.handleError(e)));
+ case ClaimStatuses.review:
+ return this.claimManagementService
+ .requestClaimReview(partyID, claimID)
+ .pipe(catchError(e => this.handleError(e)));
+ case ClaimStatuses.pending_acceptance:
+ return this.claimManagementService
+ .acceptClaim(partyID, claimID)
+ .pipe(catchError(e => this.handleError(e)));
+ case ClaimStatuses.revoked:
+ return this.claimManagementService
+ .revokeClaim(partyID, claimID, this.form.getRawValue().reason)
+ .pipe(catchError(e => this.handleError(e)));
+ default:
+ throw new Error('Wrong action type!');
+ }
+ }),
+ shareReplay(1)
+ );
+
+ isLoading$ = progress(this.updateClaim$, this.claim$).pipe(
+ shareReplay(1),
+ publish()
+ ) as ConnectableObservable;
+
+ constructor(
+ private fb: FormBuilder,
+ private claimManagementService: ClaimManagementService,
+ private snackBar: MatSnackBar
+ ) {
+ this.isLoading$.connect();
+ this.form.valueChanges
+ .pipe(
+ distinctUntilChanged((p, c) => {
+ return p.type === c.type && p.reason === c.reason;
+ }),
+ pairwise(),
+ filter(([prev, curr]) => prev.reason === curr.reason),
+ pluck(1, 'type')
+ )
+ .subscribe(type => {
+ switch (type) {
+ case ClaimStatuses.denied:
+ case ClaimStatuses.revoked:
+ this.form.setControl('reason', this.fb.control(null, Validators.required));
+ break;
+ default:
+ this.form.setControl('reason', this.fb.control(null));
+ break;
+ }
+ });
+ }
+
+ updateClaim(partyID: string, claimID: ClaimID) {
+ this.updateClaim$.next({ partyID, claimID, action: this.form.getRawValue().type });
+ }
+
+ private handleError(e: any) {
+ this.snackBar.open('Status change error', 'OK', { duration: 5000 });
+ console.error(e);
+ return [];
+ }
+
+ private initForm() {
+ return this.fb.group({
+ type: ['', Validators.required],
+ reason: null
+ });
+ }
+}
diff --git a/src/app/claim-mgt/claims/claim-actions/claim-actions.component.html b/src/app/claim-mgt/claims/claim-actions/claim-actions.component.html
new file mode 100644
index 00000000..6da93e6a
--- /dev/null
+++ b/src/app/claim-mgt/claims/claim-actions/claim-actions.component.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/app/claim-mgt/claims/claim-actions/claim-actions.component.ts b/src/app/claim-mgt/claims/claim-actions/claim-actions.component.ts
new file mode 100644
index 00000000..12954674
--- /dev/null
+++ b/src/app/claim-mgt/claims/claim-actions/claim-actions.component.ts
@@ -0,0 +1,19 @@
+import { Component } from '@angular/core';
+import { MatDialog } from '@angular/material';
+
+import { CreateClaimComponent } from '../create-claim/create-claim.component';
+
+@Component({
+ selector: 'cc-claim-actions',
+ templateUrl: 'claim-actions.component.html'
+})
+export class ClaimActionsComponent {
+ constructor(private dialogRef: MatDialog) {}
+
+ createClaim() {
+ this.dialogRef.open(CreateClaimComponent, {
+ width: '400px',
+ disableClose: true
+ });
+ }
+}
diff --git a/src/app/claim-mgt/claims/claims-routing.module.ts b/src/app/claim-mgt/claims/claims-routing.module.ts
new file mode 100644
index 00000000..e46b974e
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims-routing.module.ts
@@ -0,0 +1,22 @@
+import { NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+
+import { ClaimsComponent } from './claims.component';
+import { AppAuthGuardService } from '../../app-auth-guard.service';
+
+@NgModule({
+ imports: [
+ RouterModule.forChild([
+ {
+ path: '',
+ component: ClaimsComponent,
+ canActivate: [AppAuthGuardService],
+ data: {
+ roles: ['claim:get']
+ }
+ }
+ ])
+ ],
+ exports: [RouterModule]
+})
+export class ClaimsRoutingModule {}
diff --git a/src/app/claim-mgt/claims/claims-table/claims-table.component.css b/src/app/claim-mgt/claims/claims-table/claims-table.component.css
new file mode 100644
index 00000000..3d384031
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims-table/claims-table.component.css
@@ -0,0 +1,7 @@
+table {
+ width: 100%;
+}
+
+.action-cell {
+ width: 10px;
+}
diff --git a/src/app/claim-mgt/claims/claims-table/claims-table.component.html b/src/app/claim-mgt/claims/claims-table/claims-table.component.html
new file mode 100644
index 00000000..b8cbaf66
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims-table/claims-table.component.html
@@ -0,0 +1,45 @@
+
+
+ Party ID |
+ {{ claim.party_id }} |
+
+
+ Claim ID |
+ {{ claim.id }} |
+
+
+ Status |
+ {{ claim.status | ccClaimStatus }} |
+
+
+ Revision |
+ {{ claim.revision }} |
+
+
+ Created at |
+
+ {{ claim.created_at | date: 'dd.MM.yyyy HH:mm:ss' }}
+ |
+
+
+ Updated at |
+
+ {{ claim.updated_at | date: 'dd.MM.yyyy HH:mm:ss' }}
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
diff --git a/src/app/claim-mgt/claims/claims-table/claims-table.component.ts b/src/app/claim-mgt/claims/claims-table/claims-table.component.ts
new file mode 100644
index 00000000..341f4416
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims-table/claims-table.component.ts
@@ -0,0 +1,30 @@
+import { Component, Input } from '@angular/core';
+import { Router } from '@angular/router';
+
+import { Claim } from '../../../thrift-services/damsel/gen-model/claim_management';
+
+@Component({
+ selector: 'cc-claims-table',
+ templateUrl: 'claims-table.component.html',
+ styleUrls: ['./claims-table.component.css']
+})
+export class ClaimsTableComponent {
+ @Input()
+ claims: Claim[];
+
+ displayedColumns = [
+ 'partyID',
+ 'claimID',
+ 'status',
+ 'revision',
+ 'createdAt',
+ 'updatedAt',
+ 'actions'
+ ];
+
+ constructor(private router: Router) {}
+
+ navigateToClaim(partyID: string, claimID: number) {
+ this.router.navigate([`claim-mgt/party/${partyID}/claim/${claimID}`]);
+ }
+}
diff --git a/src/app/claim-mgt/claims/claims.component.html b/src/app/claim-mgt/claims/claims.component.html
new file mode 100644
index 00000000..19db750b
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims.component.html
@@ -0,0 +1,28 @@
+
+
+ Search claims
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claims/claims.component.ts b/src/app/claim-mgt/claims/claims.component.ts
new file mode 100644
index 00000000..f523d3a9
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims.component.ts
@@ -0,0 +1,29 @@
+import { Component, OnInit } from '@angular/core';
+
+import { ClaimsService } from './claims.service';
+import { SearchFormValue } from './search-form/search-form-value';
+import { ClaimStatus } from '../../papi/model/claim-statuses';
+
+@Component({
+ templateUrl: 'claims.component.html',
+ styleUrls: []
+})
+export class ClaimsComponent implements OnInit {
+ isLoading$ = this.claimService.isLoading$;
+ claims$ = this.claimService.claims$;
+ hasMore$ = this.claimService.hasMore$;
+
+ constructor(private claimService: ClaimsService) {}
+
+ ngOnInit(): void {
+ this.search({ statuses: [ClaimStatus.pending] });
+ }
+
+ search(searchFormValue: SearchFormValue) {
+ this.claimService.search(searchFormValue);
+ }
+
+ fetchMore() {
+ this.claimService.fetchMore();
+ }
+}
diff --git a/src/app/claim-mgt/claims/claims.module.ts b/src/app/claim-mgt/claims/claims.module.ts
new file mode 100644
index 00000000..849ed9b6
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims.module.ts
@@ -0,0 +1,62 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import {
+ MatButtonModule,
+ MatCardModule,
+ MatDialogModule,
+ MatFormFieldModule,
+ MatIconModule,
+ MatInputModule,
+ MatMenuModule,
+ MatProgressBarModule,
+ MatSelectModule,
+ MatSnackBarModule,
+ MatTableModule
+} from '@angular/material';
+import { FlexLayoutModule } from '@angular/flex-layout';
+import { ReactiveFormsModule } from '@angular/forms';
+import { CdkTableModule } from '@angular/cdk/table';
+
+import { PapiModule } from '../../papi/papi.module';
+import { ClaimsComponent } from './claims.component';
+import { ClaimsRoutingModule } from './claims-routing.module';
+import { SearchFormComponent } from './search-form/search-form.component';
+import { ClaimsTableComponent } from './claims-table/claims-table.component';
+import { ClaimActionsComponent } from './claim-actions/claim-actions.component';
+import { CreateClaimComponent } from './create-claim/create-claim.component';
+import { ClaimsService } from './claims.service';
+import { ClaimManagementService } from '../../thrift-services/damsel/claim-management.service';
+import { SharedModule } from '../../shared/shared.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ClaimsRoutingModule,
+ FlexLayoutModule,
+ PapiModule,
+ ReactiveFormsModule,
+ MatCardModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatSelectModule,
+ MatProgressBarModule,
+ MatSnackBarModule,
+ MatTableModule,
+ MatButtonModule,
+ MatIconModule,
+ MatMenuModule,
+ MatDialogModule,
+ CdkTableModule,
+ SharedModule
+ ],
+ declarations: [
+ ClaimsComponent,
+ SearchFormComponent,
+ ClaimsTableComponent,
+ ClaimActionsComponent,
+ CreateClaimComponent
+ ],
+ entryComponents: [CreateClaimComponent],
+ providers: [ClaimsService, ClaimManagementService]
+})
+export class ClaimsModule {}
diff --git a/src/app/claim-mgt/claims/claims.service.ts b/src/app/claim-mgt/claims/claims.service.ts
new file mode 100644
index 00000000..c929d904
--- /dev/null
+++ b/src/app/claim-mgt/claims/claims.service.ts
@@ -0,0 +1,53 @@
+import { Injectable } from '@angular/core';
+import { MatSnackBar } from '@angular/material';
+import { Observable } from 'rxjs';
+import { catchError, map, shareReplay } from 'rxjs/operators';
+import { FetchResult, PartialFetcher } from '@rbkmoney/partial-fetcher';
+
+import { ClaimManagementService } from '../../thrift-services/damsel/claim-management.service';
+import { SearchFormValue } from './search-form/search-form-value';
+import { booleanDebounceTime } from '../../shared/operators';
+import { convertFormValueToParams } from './convert-form-value-to-params';
+import { Claim } from '../../thrift-services/damsel/gen-model/claim_management';
+
+@Injectable()
+export class ClaimsService extends PartialFetcher {
+ private readonly searchLimit = 20;
+
+ claims$: Observable = this.searchResult$.pipe(
+ catchError(() => {
+ this.snackBar.open('An error occurred while processing your search', 'OK');
+ return [];
+ })
+ );
+
+ isLoading$: Observable = this.doAction$.pipe(
+ booleanDebounceTime(),
+ shareReplay(1)
+ );
+
+ constructor(
+ private claimManagementService: ClaimManagementService,
+ private snackBar: MatSnackBar
+ ) {
+ super();
+ }
+
+ protected fetch(
+ searchFormValue: SearchFormValue,
+ continuationToken: string
+ ): Observable> {
+ return this.claimManagementService
+ .searchClaims({
+ ...convertFormValueToParams(searchFormValue),
+ continuation_token: continuationToken,
+ limit: this.searchLimit
+ })
+ .pipe(
+ map(r => ({
+ result: r.result,
+ continuationToken: r.continuation_token
+ }))
+ );
+ }
+}
diff --git a/src/app/claim-mgt/claims/convert-form-value-to-params.ts b/src/app/claim-mgt/claims/convert-form-value-to-params.ts
new file mode 100644
index 00000000..5c04e015
--- /dev/null
+++ b/src/app/claim-mgt/claims/convert-form-value-to-params.ts
@@ -0,0 +1,19 @@
+import { SearchFormValue } from './search-form/search-form-value';
+
+export const convertFormValueToParams = (params: SearchFormValue) => {
+ const result = {};
+ for (const k in params) {
+ if (params.hasOwnProperty(k)) {
+ if (k === 'statuses') {
+ result[k] = (params[k] as string[]).reduce((acc, cv) => [...acc, { [cv]: {} }], []);
+ } else {
+ const v = params[k].trim();
+ if (v === '') {
+ break;
+ }
+ result[k] = v;
+ }
+ }
+ }
+ return result;
+};
diff --git a/src/app/claim-mgt/claims/create-claim/create-claim.component.html b/src/app/claim-mgt/claims/create-claim/create-claim.component.html
new file mode 100644
index 00000000..f19ad8fd
--- /dev/null
+++ b/src/app/claim-mgt/claims/create-claim/create-claim.component.html
@@ -0,0 +1,14 @@
+Claim creation
+
+
+
+
+
+
+
diff --git a/src/app/claim-mgt/claims/create-claim/create-claim.component.ts b/src/app/claim-mgt/claims/create-claim/create-claim.component.ts
new file mode 100644
index 00000000..221b48c3
--- /dev/null
+++ b/src/app/claim-mgt/claims/create-claim/create-claim.component.ts
@@ -0,0 +1,31 @@
+import { Component, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { MatDialogRef } from '@angular/material';
+import { Router } from '@angular/router';
+
+import { ClaimActionType } from '../../../claim/claim-action-type';
+
+@Component({
+ templateUrl: 'create-claim.component.html'
+})
+export class CreateClaimComponent implements OnInit {
+ form: FormGroup;
+
+ constructor(
+ private dialogRef: MatDialogRef,
+ private router: Router,
+ private fb: FormBuilder
+ ) {}
+
+ ngOnInit() {
+ this.form = this.fb.group({
+ partyId: ['', Validators.required]
+ });
+ }
+
+ submit() {
+ const partyId = this.form.value.partyId.trim();
+ this.dialogRef.close();
+ this.router.navigate([`/claims/${partyId}/${ClaimActionType.create}`]);
+ }
+}
diff --git a/src/app/claim-mgt/claims/index.ts b/src/app/claim-mgt/claims/index.ts
new file mode 100644
index 00000000..395f398e
--- /dev/null
+++ b/src/app/claim-mgt/claims/index.ts
@@ -0,0 +1 @@
+export * from './claims.module';
diff --git a/src/app/claim-mgt/claims/search-form/search-form-value.ts b/src/app/claim-mgt/claims/search-form/search-form-value.ts
new file mode 100644
index 00000000..650c3fae
--- /dev/null
+++ b/src/app/claim-mgt/claims/search-form/search-form-value.ts
@@ -0,0 +1,7 @@
+import * as domain from '../../../thrift-services/damsel/gen-model/domain';
+import { ClaimStatus } from '../../../papi/model/claim-statuses';
+
+export interface SearchFormValue {
+ party_id?: domain.PartyID;
+ statuses?: ClaimStatus[];
+}
diff --git a/src/app/claim-mgt/claims/search-form/search-form.component.html b/src/app/claim-mgt/claims/search-form/search-form.component.html
new file mode 100644
index 00000000..08df6491
--- /dev/null
+++ b/src/app/claim-mgt/claims/search-form/search-form.component.html
@@ -0,0 +1,13 @@
+
diff --git a/src/app/claim-mgt/claims/search-form/search-form.component.ts b/src/app/claim-mgt/claims/search-form/search-form.component.ts
new file mode 100644
index 00000000..a2d311be
--- /dev/null
+++ b/src/app/claim-mgt/claims/search-form/search-form.component.ts
@@ -0,0 +1,31 @@
+import { Component, EventEmitter, OnInit, Output } from '@angular/core';
+import { FormGroup } from '@angular/forms';
+
+import { SearchFormService } from './search-form.service';
+import { debounceTime } from 'rxjs/internal/operators';
+import { SearchFormValue } from './search-form-value';
+
+@Component({
+ selector: 'cc-search-form',
+ templateUrl: 'search-form.component.html',
+ providers: [SearchFormService]
+})
+export class SearchFormComponent implements OnInit {
+ @Output()
+ valueChanges: EventEmitter = new EventEmitter();
+
+ form: FormGroup;
+
+ claimStatuses: string[];
+
+ constructor(private searchFormService: SearchFormService) {}
+
+ ngOnInit() {
+ const { form, claimStatuses } = this.searchFormService;
+ this.claimStatuses = claimStatuses;
+ this.form = form;
+ this.form.valueChanges.pipe(debounceTime(300)).subscribe(value => {
+ this.valueChanges.emit(value);
+ });
+ }
+}
diff --git a/src/app/claim-mgt/claims/search-form/search-form.service.ts b/src/app/claim-mgt/claims/search-form/search-form.service.ts
new file mode 100644
index 00000000..8d968b01
--- /dev/null
+++ b/src/app/claim-mgt/claims/search-form/search-form.service.ts
@@ -0,0 +1,24 @@
+import { Injectable } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import values from 'lodash-es/values';
+import { ClaimStatus } from '../../../papi/model/claim-statuses';
+
+@Injectable()
+export class SearchFormService {
+ form: FormGroup;
+
+ claimStatuses: string[];
+
+ constructor(private fb: FormBuilder) {
+ this.form = this.prepareForm();
+ this.claimStatuses = values(ClaimStatus);
+ this.form.patchValue({ statuses: [ClaimStatus.pending] });
+ }
+
+ private prepareForm(): FormGroup {
+ return this.fb.group({
+ statuses: '',
+ party_id: ''
+ });
+ }
+}
diff --git a/src/app/claim/claim.module.ts b/src/app/claim/claim.module.ts
index 331bdcdf..9a23e274 100644
--- a/src/app/claim/claim.module.ts
+++ b/src/app/claim/claim.module.ts
@@ -23,7 +23,6 @@ import {
import { FlexLayoutModule } from '@angular/flex-layout';
import { PapiModule } from '../papi/papi.module';
-import { ThriftModule } from '../thrift/thrift.module';
import { ClaimRoutingModule } from './claim-routing.module';
import { ClaimComponent } from './claim.component';
import { ClaimInfoComponent } from './claim-info/claim-info.component';
@@ -44,11 +43,12 @@ import { PersistentContainerService } from './persistent-container.service';
import { CloneClaimComponent } from './clone-claim/clone-claim.component';
import { PartyModificationContainerService } from './party-modification-container/party-modification-container.service';
import { RemoveConfirmComponent } from './party-modification-container/remove-confirm/remove-confirm.component';
+import { DamselModule } from '../thrift-services/damsel/damsel.module';
@NgModule({
imports: [
PapiModule,
- ThriftModule,
+ DamselModule,
CommonModule,
SharedModule,
ReactiveFormsModule,
diff --git a/src/app/claim/claim.service.ts b/src/app/claim/claim.service.ts
index 6050c1cd..41e04968 100644
--- a/src/app/claim/claim.service.ts
+++ b/src/app/claim/claim.service.ts
@@ -17,7 +17,7 @@ import { ClaimInfo, PartyModificationUnit } from '../papi/model';
import { ClaimInfoContainer, ModificationGroup, PersistentContainer } from './model';
import { PersistentContainerService } from './persistent-container.service';
import { convert } from './party-modification-group-converter';
-import { PartyModification } from '../gen-damsel/payment_processing';
+import { PartyModification } from '../thrift-services/damsel/gen-model/payment_processing';
import { ClaimActionType } from './claim-action-type';
import { ClaimStatus } from '../papi/model/claim-statuses';
diff --git a/src/app/claim/container-name.pipe.ts b/src/app/claim/container-name.pipe.ts
index 6d88bfe8..64c2ff21 100644
--- a/src/app/claim/container-name.pipe.ts
+++ b/src/app/claim/container-name.pipe.ts
@@ -1,6 +1,6 @@
import { Pipe, PipeTransform } from '@angular/core';
-import { ContractModificationName, ShopModificationName, ModificationGroupType } from './model';
+import { ContractModificationName, ModificationGroupType, ShopModificationName } from './model';
@Pipe({
name: 'ccContainerName'
diff --git a/src/app/claim/create-modification/create-modification.component.ts b/src/app/claim/create-modification/create-modification.component.ts
index 0f6c6bc6..dd7d4df6 100644
--- a/src/app/claim/create-modification/create-modification.component.ts
+++ b/src/app/claim/create-modification/create-modification.component.ts
@@ -10,7 +10,7 @@ import {
ContractModificationUnit,
PartyModification,
ShopModificationUnit
-} from '../../gen-damsel/payment_processing';
+} from '../../thrift-services/damsel/gen-model/payment_processing';
export interface CreateModificationData {
action: ModificationAction;
diff --git a/src/app/claim/model/modification-unit-container.ts b/src/app/claim/model/modification-unit-container.ts
index 0d65b666..d91850ea 100644
--- a/src/app/claim/model/modification-unit-container.ts
+++ b/src/app/claim/model/modification-unit-container.ts
@@ -1,7 +1,7 @@
import {
ContractModificationUnit,
ShopModificationUnit
-} from '../../gen-damsel/payment_processing';
+} from '../../thrift-services/damsel/gen-model/payment_processing';
export class ModificationUnitContainer {
saved: boolean;
diff --git a/src/app/claim/model/persistent-container.ts b/src/app/claim/model/persistent-container.ts
index 600db5d8..c71b5253 100644
--- a/src/app/claim/model/persistent-container.ts
+++ b/src/app/claim/model/persistent-container.ts
@@ -1,4 +1,4 @@
-import { PartyModification } from '../../gen-damsel/payment_processing';
+import { PartyModification } from '../../thrift-services/damsel/gen-model/payment_processing';
export class PersistentContainer {
modification: PartyModification;
diff --git a/src/app/claim/party-modification-container/party-modification-container.service.ts b/src/app/claim/party-modification-container/party-modification-container.service.ts
index 21ab4b44..25d057c5 100644
--- a/src/app/claim/party-modification-container/party-modification-container.service.ts
+++ b/src/app/claim/party-modification-container/party-modification-container.service.ts
@@ -5,7 +5,7 @@ import { ContractModificationName, ModificationGroupType, ShopModificationName }
import {
ContractModificationUnit,
ShopModificationUnit
-} from '../../gen-damsel/payment_processing';
+} from '../../thrift-services/damsel/gen-model/payment_processing';
@Injectable()
export class PartyModificationContainerService {
diff --git a/src/app/claim/party-modification-group-converter.ts b/src/app/claim/party-modification-group-converter.ts
index 7f97d6c6..388793bc 100644
--- a/src/app/claim/party-modification-group-converter.ts
+++ b/src/app/claim/party-modification-group-converter.ts
@@ -6,7 +6,10 @@ import {
PartyModificationUnit,
PersistentContainer
} from './model';
-import { ContractModificationUnit, ShopModificationUnit } from '../gen-damsel/payment_processing';
+import {
+ ContractModificationUnit,
+ ShopModificationUnit
+} from '../thrift-services/damsel/gen-model/payment_processing';
import { UnitName } from '../party-modification-creation/unit-name';
interface PersistentUnit {
diff --git a/src/app/claim/party-modification-units/party-modification-units.component.ts b/src/app/claim/party-modification-units/party-modification-units.component.ts
index f825da05..3e2c97f8 100644
--- a/src/app/claim/party-modification-units/party-modification-units.component.ts
+++ b/src/app/claim/party-modification-units/party-modification-units.component.ts
@@ -1,7 +1,7 @@
import { Component, Input } from '@angular/core';
import { MatBottomSheet } from '@angular/material';
-import { PartyModificationUnit, ModificationGroupType } from '../model';
+import { ModificationGroupType, PartyModificationUnit } from '../model';
import { UnitActionsComponent } from '../unit-actions/unit-actions.component';
import { ClaimService } from '../claim.service';
diff --git a/src/app/claim/party-modifications/party-modifications.component.ts b/src/app/claim/party-modifications/party-modifications.component.ts
index 9d4504d1..1b0549e6 100644
--- a/src/app/claim/party-modifications/party-modifications.component.ts
+++ b/src/app/claim/party-modifications/party-modifications.component.ts
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { MatSnackBar } from '@angular/material';
import { ClaimService } from '../claim.service';
-import { PartyModificationUnit, ModificationGroupType } from '../model';
+import { ModificationGroupType, PartyModificationUnit } from '../model';
@Component({
selector: 'cc-party-modifications',
diff --git a/src/app/claim/persistent-container.service.ts b/src/app/claim/persistent-container.service.ts
index f270e722..2751e720 100644
--- a/src/app/claim/persistent-container.service.ts
+++ b/src/app/claim/persistent-container.service.ts
@@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import remove from 'lodash-es/remove';
import { PersistentContainer } from './model';
-import { PartyModification } from '../gen-damsel/payment_processing';
+import { PartyModification } from '../thrift-services/damsel/gen-model/payment_processing';
@Injectable()
export class PersistentContainerService {
diff --git a/src/app/claims/claims.module.ts b/src/app/claims/claims.module.ts
index 1ce67018..b00790c6 100644
--- a/src/app/claims/claims.module.ts
+++ b/src/app/claims/claims.module.ts
@@ -3,9 +3,9 @@ import { CommonModule } from '@angular/common';
import {
MatButtonModule,
MatCardModule,
+ MatDialogModule,
MatFormFieldModule,
MatIconModule,
- MatDialogModule,
MatInputModule,
MatMenuModule,
MatProgressBarModule,
diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts
index 1ba612d5..6195843a 100644
--- a/src/app/core/core.module.ts
+++ b/src/app/core/core.module.ts
@@ -3,31 +3,44 @@ import { CommonModule } from '@angular/common';
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
import { ConfigService } from './config.service';
+import { KeycloakTokenInfoService } from '../keycloak-token-info.service';
-const initializer = (keycloak: KeycloakService, configService: ConfigService) => () =>
+const initializer = (
+ keycloak: KeycloakService,
+ configService: ConfigService,
+ keycloakTokenInfoService: KeycloakTokenInfoService
+) => () =>
Promise.all([
configService.load(),
- keycloak.init({
- config: '/assets/authConfig.json',
- initOptions: {
- onLoad: 'login-required',
- checkLoginIframe: true
- },
- enableBearerInterceptor: true,
- bearerExcludedUrls: ['/assets'],
- bearerPrefix: 'Bearer'
- })
+ keycloak
+ .init({
+ config: '/assets/authConfig.json',
+ initOptions: {
+ onLoad: 'login-required',
+ checkLoginIframe: true
+ },
+ enableBearerInterceptor: true,
+ bearerExcludedUrls: ['/assets', 'https://storage.rbk.money/files'],
+ bearerPrefix: 'Bearer'
+ })
+ .then(_ => {
+ return keycloak.getToken();
+ })
+ .then(token => {
+ return keycloakTokenInfoService.init(token);
+ })
]);
@NgModule({
imports: [CommonModule, KeycloakAngularModule],
providers: [
ConfigService,
+ KeycloakTokenInfoService,
{
provide: APP_INITIALIZER,
useFactory: initializer,
multi: true,
- deps: [KeycloakService, ConfigService]
+ deps: [KeycloakService, ConfigService, KeycloakTokenInfoService]
}
]
})
diff --git a/src/app/custom-operators/polling-conditions.ts b/src/app/custom-operators/polling-conditions.ts
index 41cc31a8..57e3f7d1 100644
--- a/src/app/custom-operators/polling-conditions.ts
+++ b/src/app/custom-operators/polling-conditions.ts
@@ -1,4 +1,4 @@
-import { StatDeposit } from '../fistful/gen-model/fistful_stat';
+import { StatDeposit } from '../thrift-services/fistful/gen-model/fistful_stat';
import { depositStatus } from '../deposits/deposit-status';
export const createDepositStopPollingCondition = (deposit: StatDeposit): boolean =>
diff --git a/src/app/damsel-meta/definition.service.ts b/src/app/damsel-meta/definition.service.ts
index 0a06b8d4..804f524c 100644
--- a/src/app/damsel-meta/definition.service.ts
+++ b/src/app/damsel-meta/definition.service.ts
@@ -4,7 +4,7 @@ import { Observable, of } from 'rxjs';
import { shareReplay, map } from 'rxjs/operators';
import { Field } from 'thrift-ts';
-import { Reference } from '../gen-damsel/domain';
+import { Reference } from '../thrift-services/damsel/gen-model/domain';
import { ASTDefinition } from './model';
@Injectable()
diff --git a/src/app/damsel-meta/meta-builder/enrichment/meta-enricher.ts b/src/app/damsel-meta/meta-builder/enrichment/meta-enricher.ts
index 26e480df..73963f89 100644
--- a/src/app/damsel-meta/meta-builder/enrichment/meta-enricher.ts
+++ b/src/app/damsel-meta/meta-builder/enrichment/meta-enricher.ts
@@ -157,7 +157,7 @@ export class MetaEnricher {
return this.enrichTyped(found);
}
- private findMeta(condition: MetaTypeCondition): MetaTyped & MetaTypeDefined | null {
+ private findMeta(condition: MetaTypeCondition): (MetaTyped & MetaTypeDefined) | null {
let found = findMeta(condition, this.shallowMetaDef);
if (found) {
return found;
diff --git a/src/app/damsel-meta/thrift-builder/build-thrift.ts b/src/app/damsel-meta/thrift-builder/build-thrift.ts
index 1063c01a..4735d701 100644
--- a/src/app/damsel-meta/thrift-builder/build-thrift.ts
+++ b/src/app/damsel-meta/thrift-builder/build-thrift.ts
@@ -8,7 +8,7 @@ import {
MetaStruct,
MetaUnion
} from '../model';
-import { getThriftInstance } from '../../thrift';
+import { getThriftInstance } from '../../thrift-services';
export type ThriftType = any;
diff --git a/src/app/deposits/create-deposit/create-deposit.service.ts b/src/app/deposits/create-deposit/create-deposit.service.ts
index 8cb0ef97..cd2391dd 100644
--- a/src/app/deposits/create-deposit/create-deposit.service.ts
+++ b/src/app/deposits/create-deposit/create-deposit.service.ts
@@ -7,11 +7,11 @@ import { Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { toMajor } from '../to-major-amount';
-import { DepositParams } from '../../fistful/gen-model/fistful_admin';
-import { StatDeposit } from '../../fistful/gen-model/fistful_stat';
+import { DepositParams } from '../../thrift-services/fistful/gen-model/fistful_admin';
+import { StatDeposit } from '../../thrift-services/fistful/gen-model/fistful_stat';
import { SearchFormParams } from '../search-form/search-form-params';
-import { FistfulAdminService } from '../../fistful/fistful-admin.service';
-import { FistfulStatisticsService } from '../../fistful/fistful-stat.service';
+import { FistfulAdminService } from '../../thrift-services/fistful/fistful-admin.service';
+import { FistfulStatisticsService } from '../../thrift-services/fistful/fistful-stat.service';
import { createDepositStopPollingCondition, poll } from '../../custom-operators';
export interface CurrencySource {
diff --git a/src/app/deposits/deposit-status.pipe.ts b/src/app/deposits/deposit-status.pipe.ts
index a8eb4697..92e03c06 100644
--- a/src/app/deposits/deposit-status.pipe.ts
+++ b/src/app/deposits/deposit-status.pipe.ts
@@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
-import { DepositStatus } from '../fistful/gen-model/fistful_stat';
+import { DepositStatus } from '../thrift-services/fistful/gen-model/fistful_stat';
import { depositStatus } from './deposit-status';
@Pipe({
diff --git a/src/app/deposits/deposit-status.ts b/src/app/deposits/deposit-status.ts
index a5aa884d..981ddb5f 100644
--- a/src/app/deposits/deposit-status.ts
+++ b/src/app/deposits/deposit-status.ts
@@ -1,4 +1,4 @@
-import { DepositStatus } from '../fistful/gen-model/fistful_stat';
+import { DepositStatus } from '../thrift-services/fistful/gen-model/fistful_stat';
import { clearNullFields } from '../shared/thrift-utils';
export const depositStatus = (status: DepositStatus): string =>
diff --git a/src/app/deposits/deposits-table/deposits-table.component.ts b/src/app/deposits/deposits-table/deposits-table.component.ts
index 3ddcf96e..11a7c2df 100644
--- a/src/app/deposits/deposits-table/deposits-table.component.ts
+++ b/src/app/deposits/deposits-table/deposits-table.component.ts
@@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core';
-import { StatDeposit } from '../../fistful/gen-model/fistful_stat';
+import { StatDeposit } from '../../thrift-services/fistful/gen-model/fistful_stat';
@Component({
selector: 'cc-deposits-table',
diff --git a/src/app/deposits/deposits.module.ts b/src/app/deposits/deposits.module.ts
index ba44c4f1..dcaedb7a 100644
--- a/src/app/deposits/deposits.module.ts
+++ b/src/app/deposits/deposits.module.ts
@@ -16,12 +16,12 @@ import { DepositsRoutingModule } from './deposits-routing.module';
import { DepositsComponent } from './deposits.component';
import { CreateDepositComponent } from './create-deposit/create-deposit.component';
import { CreateDepositService } from './create-deposit/create-deposit.service';
-import { FistfulAdminService } from '../fistful/fistful-admin.service';
+import { FistfulAdminService } from '../thrift-services/fistful/fistful-admin.service';
import { DepositsTableComponent } from './deposits-table/deposits-table.component';
import { DepositsTableService } from './deposits-table/deposits-table.service';
import { SearchFormService } from './search-form/search-form.service';
import { DepositsService } from './deposits.service';
-import { FistfulStatisticsService } from '../fistful/fistful-stat.service';
+import { FistfulStatisticsService } from '../thrift-services/fistful/fistful-stat.service';
import { SearchFormComponent } from './search-form/search-form.component';
import { DepositStatusPipe } from './deposit-status.pipe';
import { MatDialogModule } from '@angular/material/dialog';
diff --git a/src/app/deposits/deposits.service.ts b/src/app/deposits/deposits.service.ts
index e6363617..cd0149fb 100644
--- a/src/app/deposits/deposits.service.ts
+++ b/src/app/deposits/deposits.service.ts
@@ -5,8 +5,8 @@ import { Observable } from 'rxjs';
import { filter, shareReplay } from 'rxjs/operators';
import * as moment from 'moment';
-import { StatDeposit } from '../fistful/gen-model/fistful_stat';
-import { FistfulStatisticsService } from '../fistful/fistful-stat.service';
+import { StatDeposit } from '../thrift-services/fistful/gen-model/fistful_stat';
+import { FistfulStatisticsService } from '../thrift-services/fistful/fistful-stat.service';
import { SearchFormParams } from './search-form/search-form-params';
import { booleanDelay } from '../custom-operators';
import { CreateDepositComponent } from './create-deposit/create-deposit.component';
diff --git a/src/app/domain/domain-info/domain-details.service.ts b/src/app/domain/domain-info/domain-details.service.ts
index adb81e77..5c4c4d4f 100644
--- a/src/app/domain/domain-info/domain-details.service.ts
+++ b/src/app/domain/domain-info/domain-details.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
-import { DomainPair } from './domain-group/domain-group';
+import { DomainPair } from './domain-group';
@Injectable()
export class DomainDetailsService {
diff --git a/src/app/domain/domain-info/domain-group/domain-group.module.ts b/src/app/domain/domain-info/domain-group/domain-group.module.ts
index a414fbbd..fd1f0db5 100644
--- a/src/app/domain/domain-info/domain-group/domain-group.module.ts
+++ b/src/app/domain/domain-info/domain-group/domain-group.module.ts
@@ -1,20 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
- MatExpansionModule,
- MatTableModule,
- MatPaginatorModule,
- MatIconModule,
MatButtonModule,
- MatInputModule,
MatCardModule,
MatCheckboxModule,
- MatSelectModule
+ MatExpansionModule,
+ MatIconModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatSelectModule,
+ MatSortModule,
+ MatTableModule
} from '@angular/material';
import { CdkTableModule } from '@angular/cdk/table';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule } from '@angular/forms';
-import { MatSortModule } from '@angular/material';
import { DomainGroupComponent } from './domain-group.component';
import { SharedModule } from '../../../shared/shared.module';
diff --git a/src/app/domain/domain-info/domain-group/domain-group.service.ts b/src/app/domain/domain-info/domain-group/domain-group.service.ts
index 16264e46..95faf7ed 100644
--- a/src/app/domain/domain-info/domain-group/domain-group.service.ts
+++ b/src/app/domain/domain-info/domain-group/domain-group.service.ts
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
-import { Observable, AsyncSubject } from 'rxjs';
+import { AsyncSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { group } from './group-domain-objects';
diff --git a/src/app/domain/domain-info/domain-group/domain-group.ts b/src/app/domain/domain-info/domain-group/domain-group.ts
index de004446..41cf6ef2 100644
--- a/src/app/domain/domain-info/domain-group/domain-group.ts
+++ b/src/app/domain/domain-info/domain-group/domain-group.ts
@@ -1,4 +1,4 @@
-import { Reference } from '../../../gen-damsel/domain_config';
+import { Reference } from '../../../thrift-services/damsel/gen-model/domain_config';
export interface AbstractDomainObject {
ref: any;
diff --git a/src/app/domain/domain-info/domain-group/domain-objects-type-selector/domain-objects-type-selector.component.ts b/src/app/domain/domain-info/domain-group/domain-objects-type-selector/domain-objects-type-selector.component.ts
index e1a519a9..cd85c381 100644
--- a/src/app/domain/domain-info/domain-group/domain-objects-type-selector/domain-objects-type-selector.component.ts
+++ b/src/app/domain/domain-info/domain-group/domain-objects-type-selector/domain-objects-type-selector.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, SimpleChanges, OnChanges, Output, EventEmitter } from '@angular/core';
+import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { NgModel } from '@angular/forms';
import { MatSelectChange } from '@angular/material';
diff --git a/src/app/domain/domain-info/domain-group/group-control/group-control.component.ts b/src/app/domain/domain-info/domain-group/group-control/group-control.component.ts
index 688143aa..004e5b7d 100644
--- a/src/app/domain/domain-info/domain-group/group-control/group-control.component.ts
+++ b/src/app/domain/domain-info/domain-group/group-control/group-control.component.ts
@@ -1,4 +1,4 @@
-import { Component, Output, EventEmitter, Input } from '@angular/core';
+import { Component, EventEmitter, Input, Output } from '@angular/core';
import { DomainGroup } from '../domain-group';
diff --git a/src/app/domain/domain-info/domain-group/group-domain-objects.ts b/src/app/domain/domain-info/domain-group/group-domain-objects.ts
index 223fb56a..755bf048 100644
--- a/src/app/domain/domain-info/domain-group/group-domain-objects.ts
+++ b/src/app/domain/domain-info/domain-group/group-domain-objects.ts
@@ -2,7 +2,7 @@ import { Field } from 'thrift-ts';
import { clearNullFields } from '../../../shared/thrift-utils';
import { DomainGroup } from './domain-group';
-import { Domain } from '../../../gen-damsel/domain';
+import { Domain } from '../../../thrift-services/damsel/gen-model/domain';
function getTypeDef(domainObjDef: Field[]) {
return domainObjDef.reduce(
diff --git a/src/app/domain/domain-info/domain-group/group-table/group-table.component.ts b/src/app/domain/domain-info/domain-group/group-table/group-table.component.ts
index 411be242..fc4a7516 100644
--- a/src/app/domain/domain-info/domain-group/group-table/group-table.component.ts
+++ b/src/app/domain/domain-info/domain-group/group-table/group-table.component.ts
@@ -1,13 +1,13 @@
-import { Component, OnInit, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
-import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
+import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
+import { MatPaginator, MatSort, MatTableDataSource } from '@angular/material';
import { DomainGroup } from '../domain-group';
-import { DomainDetailsService } from '../../../domain-info/domain-details.service';
-import { toTableGroup, toDataSource } from './table-group';
+import { DomainDetailsService } from '../../domain-details.service';
+import { toDataSource, toTableGroup } from './table-group';
import { sortData } from './sort-table-data';
import { filterPredicate } from './filter-predicate';
import { TableDataSource, TableGroup } from './model';
-import { DetailsContainerService } from '../../../domain-info/details-container.service';
+import { DetailsContainerService } from '../../details-container.service';
@Component({
selector: 'cc-group-table',
diff --git a/src/app/domain/domain-info/domain-group/group-table/table-group.ts b/src/app/domain/domain-info/domain-group/group-table/table-group.ts
index 2ac343a2..f3048fb1 100644
--- a/src/app/domain/domain-info/domain-group/group-table/table-group.ts
+++ b/src/app/domain/domain-info/domain-group/group-table/table-group.ts
@@ -1,6 +1,6 @@
import { DomainGroup } from '../domain-group';
import { toJson } from '../../../../shared/thrift-json-converter';
-import { TableGroup, TableDataSource } from './model';
+import { TableDataSource, TableGroup } from './model';
function shorten(str: string, limit = 150): string {
return str.length > limit ? str.slice(0, limit) + '...' : str;
diff --git a/src/app/domain/domain-info/domain-info.module.ts b/src/app/domain/domain-info/domain-info.module.ts
index abd8943a..8123159d 100644
--- a/src/app/domain/domain-info/domain-info.module.ts
+++ b/src/app/domain/domain-info/domain-info.module.ts
@@ -1,13 +1,13 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
- MatCardModule,
- MatProgressBarModule,
- MatSnackBarModule,
- MatSidenavModule,
MatButtonModule,
+ MatCardModule,
MatInputModule,
- MatProgressSpinnerModule
+ MatProgressBarModule,
+ MatProgressSpinnerModule,
+ MatSidenavModule,
+ MatSnackBarModule
} from '@angular/material';
import { FlexLayoutModule } from '@angular/flex-layout';
@@ -15,7 +15,7 @@ import { DomainInfoComponent } from './domain-info.component';
import { DomainObjDetailsComponent } from './domain-obj-details';
import { DomainGroupModule } from './domain-group';
import { MonacoEditorModule } from '../../monaco-editor';
-import { ThriftModule } from '../../thrift/thrift.module';
+import { DamselModule } from '../../thrift-services/damsel/damsel.module';
import { SharedModule } from '../../shared/shared.module';
@NgModule({
@@ -32,7 +32,7 @@ import { SharedModule } from '../../shared/shared.module';
MatInputModule,
MatProgressSpinnerModule,
MonacoEditorModule,
- ThriftModule,
+ DamselModule,
SharedModule
]
})
diff --git a/src/app/domain/domain-info/domain-info.service.ts b/src/app/domain/domain-info/domain-info.service.ts
index 14dbb129..09d22f30 100644
--- a/src/app/domain/domain-info/domain-info.service.ts
+++ b/src/app/domain/domain-info/domain-info.service.ts
@@ -1,11 +1,11 @@
import { Injectable } from '@angular/core';
-import { Observable, combineLatest, Subject, AsyncSubject } from 'rxjs';
-import { tap, map } from 'rxjs/operators';
+import { AsyncSubject, combineLatest, Observable, Subject } from 'rxjs';
+import { map, tap } from 'rxjs/operators';
import { Field } from 'thrift-ts';
import { DomainService } from '../domain.service';
import { MetadataService } from '../metadata.service';
-import { Snapshot } from '../../gen-damsel/domain_config';
+import { Snapshot } from '../../thrift-services/damsel/gen-model/domain_config';
export interface Payload {
shapshot: Snapshot;
diff --git a/src/app/domain/domain-info/domain-obj-details/domain-obj-details.component.ts b/src/app/domain/domain-info/domain-obj-details/domain-obj-details.component.ts
index d71f384e..2bec3728 100644
--- a/src/app/domain/domain-info/domain-obj-details/domain-obj-details.component.ts
+++ b/src/app/domain/domain-info/domain-obj-details/domain-obj-details.component.ts
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { DomainDetailsService } from '../domain-details.service';
-import { MonacoFile, IEditorOptions } from '../../../monaco-editor';
+import { IEditorOptions, MonacoFile } from '../../../monaco-editor';
@Component({
selector: 'cc-domain-obj-details',
diff --git a/src/app/domain/domain-modification-model.ts b/src/app/domain/domain-modification-model.ts
index 8845787b..5e63011c 100644
--- a/src/app/domain/domain-modification-model.ts
+++ b/src/app/domain/domain-modification-model.ts
@@ -1,4 +1,4 @@
-import { Reference, DomainObject } from '../gen-damsel/domain';
+import { Reference, DomainObject } from '../thrift-services/damsel/gen-model/domain';
import { MetaStruct, MetaUnion } from '../damsel-meta';
export interface ModificationItem {
diff --git a/src/app/domain/domain-obj-modification/domain-obj-code-lens-provider.ts b/src/app/domain/domain-obj-modification/domain-obj-code-lens-provider.ts
index 33bbc713..c526c33e 100644
--- a/src/app/domain/domain-obj-modification/domain-obj-code-lens-provider.ts
+++ b/src/app/domain/domain-obj-modification/domain-obj-code-lens-provider.ts
@@ -4,7 +4,7 @@ import {
CancellationToken,
ICodeLensSymbol,
ProviderResult
-} from '../../monaco-editor/model';
+} from '../../monaco-editor';
export class DomainObjCodeLensProvider implements CodeLensProvider {
get language() {
diff --git a/src/app/domain/domain-obj-modification/domain-obj-modification.component.ts b/src/app/domain/domain-obj-modification/domain-obj-modification.component.ts
index b53a3217..75df6339 100644
--- a/src/app/domain/domain-obj-modification/domain-obj-modification.component.ts
+++ b/src/app/domain/domain-obj-modification/domain-obj-modification.component.ts
@@ -3,7 +3,7 @@ import { MatSnackBar, MatDialog } from '@angular/material';
import { Router } from '@angular/router';
import { Subscription } from 'rxjs';
-import { MonacoFile, CodeLensProvider, CompletionProvider } from '../../monaco-editor/model';
+import { MonacoFile, CodeLensProvider, CompletionProvider } from '../../monaco-editor';
import { DomainObjModificationService } from './domain-obj-modification.service';
import { DomainObjCodeLensProvider } from './domain-obj-code-lens-provider';
import { DomainObjCompletionProvider } from './domain-obj-completion-provider';
diff --git a/src/app/domain/domain-obj-modification/domain-obj-modification.module.ts b/src/app/domain/domain-obj-modification/domain-obj-modification.module.ts
index d0594ec7..9056e9d5 100644
--- a/src/app/domain/domain-obj-modification/domain-obj-modification.module.ts
+++ b/src/app/domain/domain-obj-modification/domain-obj-modification.module.ts
@@ -11,7 +11,7 @@ import { MatIconModule } from '@angular/material/icon';
import { RouterModule } from '@angular/router';
import { DomainObjModificationComponent } from './domain-obj-modification.component';
-import { MonacoEditorModule } from '../../monaco-editor/monaco-editor.module';
+import { MonacoEditorModule } from '../../monaco-editor';
import { SharedModule } from '../../shared/shared.module';
import { ResetConfirmDialogComponent } from './reset-confirm-dialog/reset-confirm-dialog.component';
diff --git a/src/app/domain/domain-obj-modification/domain-obj-modification.service.ts b/src/app/domain/domain-obj-modification/domain-obj-modification.service.ts
index c2a9ce9d..29411350 100644
--- a/src/app/domain/domain-obj-modification/domain-obj-modification.service.ts
+++ b/src/app/domain/domain-obj-modification/domain-obj-modification.service.ts
@@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router';
import { Observable, combineLatest, Subject, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
-import { DomainObject, Reference } from '../../gen-damsel/domain';
+import { DomainObject, Reference } from '../../thrift-services/damsel/gen-model/domain';
import { MetadataService } from '../metadata.service';
import { DomainService } from '../domain.service';
import { MetaBuilder } from '../../damsel-meta/meta-builder.service';
@@ -12,7 +12,7 @@ import { toMonacoContent, parseRef } from '../utils';
import { DomainReviewService } from '../domain-review.service';
import { DomainModificationModel, ModificationItem } from '../domain-modification-model';
import { ThriftBuilderService } from '../../damsel-meta/thrift-builder.service';
-import { getThriftInstance } from '../../thrift';
+import { getThriftInstance } from '../../thrift-services';
import { ThriftType } from '../../damsel-meta/thrift-builder';
@Injectable()
diff --git a/src/app/domain/domain-obj-review/domain-obj-review.component.ts b/src/app/domain/domain-obj-review/domain-obj-review.component.ts
index 4c754a2f..52ffc2a0 100644
--- a/src/app/domain/domain-obj-review/domain-obj-review.component.ts
+++ b/src/app/domain/domain-obj-review/domain-obj-review.component.ts
@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { MatCheckboxChange, MatSnackBar } from '@angular/material';
import { Subscription } from 'rxjs';
-import { MonacoFile, IDiffEditorOptions } from '../../monaco-editor/model';
+import { MonacoFile, IDiffEditorOptions } from '../../monaco-editor';
import { toMonacoFile } from '../utils';
import { DomainModificationModel } from '../domain-modification-model';
import { DomainObjReviewService } from './domain-obj-review.service';
diff --git a/src/app/domain/domain-obj-review/domain-obj-review.module.ts b/src/app/domain/domain-obj-review/domain-obj-review.module.ts
index 2a8e0aa9..26ebc244 100644
--- a/src/app/domain/domain-obj-review/domain-obj-review.module.ts
+++ b/src/app/domain/domain-obj-review/domain-obj-review.module.ts
@@ -10,7 +10,7 @@ import {
} from '@angular/material';
import { DomainObjReviewComponent } from './domain-obj-review.component';
-import { MonacoEditorModule } from '../../monaco-editor/monaco-editor.module';
+import { MonacoEditorModule } from '../../monaco-editor';
import { SharedModule } from '../../shared/shared.module';
@NgModule({
diff --git a/src/app/domain/domain-obj-review/domain-obj-review.service.ts b/src/app/domain/domain-obj-review/domain-obj-review.service.ts
index 02e8e2a2..cd0948ab 100644
--- a/src/app/domain/domain-obj-review/domain-obj-review.service.ts
+++ b/src/app/domain/domain-obj-review/domain-obj-review.service.ts
@@ -4,7 +4,7 @@ import { Observable, combineLatest } from 'rxjs';
import { DomainModificationModel } from '../domain-modification-model';
import { DomainService } from '../domain.service';
-import { Version } from '../../gen-damsel/domain_config';
+import { Version } from '../../thrift-services/damsel/gen-model/domain_config';
import { DomainReviewService } from '../domain-review.service';
import { tap } from 'rxjs/operators';
diff --git a/src/app/domain/domain.service.ts b/src/app/domain/domain.service.ts
index 6dc4354b..08b2b204 100644
--- a/src/app/domain/domain.service.ts
+++ b/src/app/domain/domain.service.ts
@@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
-import { DomainService as ThriftDomainService } from '../thrift/domain.service';
-import { toGenReference, toGenCommit } from '../thrift/converters';
-import { Snapshot, Commit } from '../gen-damsel/domain_config';
-import { Reference, DomainObject } from '../gen-damsel/domain';
+import { DomainService as ThriftDomainService } from '../thrift-services/damsel/domain.service';
+import { toGenReference, toGenCommit } from '../thrift-services/converters';
+import { Snapshot, Commit } from '../thrift-services/damsel/gen-model/domain_config';
+import { Reference, DomainObject } from '../thrift-services/damsel/gen-model/domain';
import { toJson } from '../shared/thrift-json-converter';
@Injectable()
diff --git a/src/app/domain/metadata.service.ts b/src/app/domain/metadata.service.ts
index a1828582..1da993cf 100644
--- a/src/app/domain/metadata.service.ts
+++ b/src/app/domain/metadata.service.ts
@@ -4,7 +4,7 @@ import { Observable, of } from 'rxjs';
import { shareReplay, map } from 'rxjs/operators';
import { JsonAST, Field } from 'thrift-ts';
-import { Reference } from '../gen-damsel/domain';
+import { Reference } from '../thrift-services/damsel/gen-model/domain';
export interface Metadata {
path: string;
diff --git a/src/app/domain/utils.ts b/src/app/domain/utils.ts
index 258c070f..3cfa8bd5 100644
--- a/src/app/domain/utils.ts
+++ b/src/app/domain/utils.ts
@@ -1,6 +1,6 @@
import * as uuid from 'uuid/v4';
-import { Reference, DomainObject } from '../gen-damsel/domain';
+import { DomainObject, Reference } from '../thrift-services/damsel/gen-model/domain';
import { MonacoFile } from '../monaco-editor';
import { toJson } from '../shared/thrift-json-converter';
import { extract } from '../shared/thrift-utils';
diff --git a/src/app/jsonc/json-parser.ts b/src/app/jsonc/json-parser.ts
index 84387630..c5b9986a 100644
--- a/src/app/jsonc/json-parser.ts
+++ b/src/app/jsonc/json-parser.ts
@@ -1,6 +1,7 @@
import { JSONSchema } from './json-schema';
import * as Json from 'jsonc-parser';
import * as nls from './nlc';
+
const localize = nls.loadMessageBundle();
export interface IRange {
diff --git a/src/app/keycloak-token-info.service.ts b/src/app/keycloak-token-info.service.ts
new file mode 100644
index 00000000..7b4029a3
--- /dev/null
+++ b/src/app/keycloak-token-info.service.ts
@@ -0,0 +1,13 @@
+import { Injectable } from '@angular/core';
+import * as jwtDecode from 'jwt-decode';
+
+@Injectable()
+export class KeycloakTokenInfoService {
+ userToken: string;
+ decodedUserToken: any;
+
+ init(token: string) {
+ this.userToken = token;
+ this.decodedUserToken = jwtDecode(token);
+ }
+}
diff --git a/src/app/papi/model/claim-statuses.ts b/src/app/papi/model/claim-statuses.ts
index d650ef7e..3271be81 100644
--- a/src/app/papi/model/claim-statuses.ts
+++ b/src/app/papi/model/claim-statuses.ts
@@ -2,5 +2,7 @@ export enum ClaimStatus {
accepted = 'accepted',
denied = 'denied',
revoked = 'revoked',
- pending = 'pending'
+ pending = 'pending',
+ review = 'review',
+ pending_acceptance = 'pending_acceptance'
}
diff --git a/src/app/papi/model/index.ts b/src/app/papi/model/index.ts
index 2d013827..247a9e07 100644
--- a/src/app/papi/model/index.ts
+++ b/src/app/papi/model/index.ts
@@ -9,3 +9,4 @@ export * from './payment';
export * from './invoice';
export * from './claim-created';
export * from './payout-types';
+export * from './claim-statuses';
diff --git a/src/app/papi/model/party-modification-unit.ts b/src/app/papi/model/party-modification-unit.ts
index 93148525..e2485b67 100644
--- a/src/app/papi/model/party-modification-unit.ts
+++ b/src/app/papi/model/party-modification-unit.ts
@@ -1,4 +1,4 @@
-import { PartyModification } from '../../gen-damsel/payment_processing';
+import { PartyModification } from '../../thrift-services/damsel/gen-model/payment_processing';
export class PartyModificationUnit {
modifications: PartyModification[];
diff --git a/src/app/papi/party.service.ts b/src/app/papi/party.service.ts
index 2657bc62..a6a9c8d2 100644
--- a/src/app/papi/party.service.ts
+++ b/src/app/papi/party.service.ts
@@ -6,7 +6,7 @@ import { map } from 'rxjs/operators';
import { ConfigService } from '../core/config.service';
import { ContractTemplate } from './model';
import { decode } from '../shared/java-thrift-formatter';
-import { Party } from '../gen-damsel/domain';
+import { Party } from '../thrift-services/damsel/gen-model/domain';
@Injectable()
export class PartyService {
diff --git a/src/app/party-modification-creation/business-schedule-ref/business-schedule-ref.component.ts b/src/app/party-modification-creation/business-schedule-ref/business-schedule-ref.component.ts
index ddfbf600..c4914513 100644
--- a/src/app/party-modification-creation/business-schedule-ref/business-schedule-ref.component.ts
+++ b/src/app/party-modification-creation/business-schedule-ref/business-schedule-ref.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import get from 'lodash-es/get';
-import { BusinessScheduleRef } from '../../gen-damsel/domain';
+import { BusinessScheduleRef } from '../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-business-schedule-ref',
diff --git a/src/app/party-modification-creation/business-schedule-ref/business-schedule-selector/business-schedule-selector.component.ts b/src/app/party-modification-creation/business-schedule-ref/business-schedule-selector/business-schedule-selector.component.ts
index 32d52f5c..779ebd28 100644
--- a/src/app/party-modification-creation/business-schedule-ref/business-schedule-selector/business-schedule-selector.component.ts
+++ b/src/app/party-modification-creation/business-schedule-ref/business-schedule-selector/business-schedule-selector.component.ts
@@ -3,8 +3,8 @@ import { MatSelectChange, MatSnackBar } from '@angular/material';
import { tap } from 'rxjs/internal/operators';
import { Observable } from 'rxjs';
-import { BusinessScheduleObject } from '../../../gen-damsel/domain';
-import { DomainTypedManager } from '../../../thrift';
+import { BusinessScheduleObject } from '../../../thrift-services/damsel/gen-model/domain';
+import { DomainTypedManager } from '../../../thrift-services';
@Component({
selector: 'cc-business-schedule-selector',
diff --git a/src/app/party-modification-creation/contract/adjustment-modification-unit/adjustment-modification-unit.component.ts b/src/app/party-modification-creation/contract/adjustment-modification-unit/adjustment-modification-unit.component.ts
index 565c7f3c..e209d4c9 100644
--- a/src/app/party-modification-creation/contract/adjustment-modification-unit/adjustment-modification-unit.component.ts
+++ b/src/app/party-modification-creation/contract/adjustment-modification-unit/adjustment-modification-unit.component.ts
@@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import * as uuid from 'uuid/v4';
import get from 'lodash-es/get';
-import { ContractAdjustmentModificationUnit } from '../../../gen-damsel/payment_processing';
+import { ContractAdjustmentModificationUnit } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-adjustment-modification-unit',
diff --git a/src/app/party-modification-creation/contract/adjustment-modification/adjustment-modification.component.ts b/src/app/party-modification-creation/contract/adjustment-modification/adjustment-modification.component.ts
index 91bbe3d7..dd1ca577 100644
--- a/src/app/party-modification-creation/contract/adjustment-modification/adjustment-modification.component.ts
+++ b/src/app/party-modification-creation/contract/adjustment-modification/adjustment-modification.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { ContractAdjustmentModification } from '../../../gen-damsel/payment_processing';
+import { ContractAdjustmentModification } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-adjustment-modification',
diff --git a/src/app/party-modification-creation/contract/adjustment-params/adjustment-params.component.ts b/src/app/party-modification-creation/contract/adjustment-params/adjustment-params.component.ts
index 9282c50f..52eda8b0 100644
--- a/src/app/party-modification-creation/contract/adjustment-params/adjustment-params.component.ts
+++ b/src/app/party-modification-creation/contract/adjustment-params/adjustment-params.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { ContractAdjustmentParams } from '../../../gen-damsel/payment_processing';
+import { ContractAdjustmentParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-contract-adjustment-params',
diff --git a/src/app/party-modification-creation/contract/contract-params/contract-params.component.ts b/src/app/party-modification-creation/contract/contract-params/contract-params.component.ts
index c0358a12..39a7116f 100644
--- a/src/app/party-modification-creation/contract/contract-params/contract-params.component.ts
+++ b/src/app/party-modification-creation/contract/contract-params/contract-params.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { get } from 'lodash-es';
-import { ContractParams } from '../../../gen-damsel/payment_processing';
+import { ContractParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-contract-params',
diff --git a/src/app/party-modification-creation/contract/contract-template-ref/contract-template-ref.component.ts b/src/app/party-modification-creation/contract/contract-template-ref/contract-template-ref.component.ts
index ed084e48..35783073 100644
--- a/src/app/party-modification-creation/contract/contract-template-ref/contract-template-ref.component.ts
+++ b/src/app/party-modification-creation/contract/contract-template-ref/contract-template-ref.component.ts
@@ -8,7 +8,7 @@ import get from 'lodash-es/get';
import { ContractTemplate } from '../../../papi/model';
import { ContractService } from '../../../papi/contract.service';
-import { ContractTemplateRef } from '../../../gen-damsel/domain';
+import { ContractTemplateRef } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-contract-template-ref',
diff --git a/src/app/party-modification-creation/contract/contractor/contractor.component.ts b/src/app/party-modification-creation/contract/contractor/contractor.component.ts
index 1c3aef46..34275060 100644
--- a/src/app/party-modification-creation/contract/contractor/contractor.component.ts
+++ b/src/app/party-modification-creation/contract/contractor/contractor.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { Contractor } from '../../../gen-damsel/domain';
+import { Contractor } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-contractor',
diff --git a/src/app/party-modification-creation/contract/legal-agreement-binding/legal-agreement-binding.component.ts b/src/app/party-modification-creation/contract/legal-agreement-binding/legal-agreement-binding.component.ts
index dd478d05..907d6c41 100644
--- a/src/app/party-modification-creation/contract/legal-agreement-binding/legal-agreement-binding.component.ts
+++ b/src/app/party-modification-creation/contract/legal-agreement-binding/legal-agreement-binding.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import get from 'lodash-es/get';
-import { LegalAgreement } from '../../../gen-damsel/domain';
+import { LegalAgreement } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-legal-agreement-binding',
diff --git a/src/app/party-modification-creation/contract/legal-entity/international-legal-entity/international-legal-entity.component.ts b/src/app/party-modification-creation/contract/legal-entity/international-legal-entity/international-legal-entity.component.ts
index a601bf17..a55cb95c 100644
--- a/src/app/party-modification-creation/contract/legal-entity/international-legal-entity/international-legal-entity.component.ts
+++ b/src/app/party-modification-creation/contract/legal-entity/international-legal-entity/international-legal-entity.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
-import { InternationalLegalEntity } from '../../../../gen-damsel/domain';
+import { InternationalLegalEntity } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-international-legal-entity',
diff --git a/src/app/party-modification-creation/contract/legal-entity/legal-entity.component.ts b/src/app/party-modification-creation/contract/legal-entity/legal-entity.component.ts
index 3bf01559..0b0bd496 100644
--- a/src/app/party-modification-creation/contract/legal-entity/legal-entity.component.ts
+++ b/src/app/party-modification-creation/contract/legal-entity/legal-entity.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import get from 'lodash-es/get';
-import { LegalEntity } from '../../../gen-damsel/domain';
+import { LegalEntity } from '../../../thrift-services/damsel/gen-model/domain';
enum Type {
russianLegalEntity = 'russian_legal_entity',
diff --git a/src/app/party-modification-creation/contract/legal-entity/russian-legal-entity/russian-legal-entity.component.ts b/src/app/party-modification-creation/contract/legal-entity/russian-legal-entity/russian-legal-entity.component.ts
index 5f4fbc04..701dba25 100644
--- a/src/app/party-modification-creation/contract/legal-entity/russian-legal-entity/russian-legal-entity.component.ts
+++ b/src/app/party-modification-creation/contract/legal-entity/russian-legal-entity/russian-legal-entity.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import get from 'lodash-es/get';
-import { RussianLegalEntity } from '../../../../gen-damsel/domain';
+import { RussianLegalEntity } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-russian-legal-entity',
diff --git a/src/app/party-modification-creation/contract/payment-institution/payment-institution-ref.component.ts b/src/app/party-modification-creation/contract/payment-institution/payment-institution-ref.component.ts
index 79ce9082..460c9176 100644
--- a/src/app/party-modification-creation/contract/payment-institution/payment-institution-ref.component.ts
+++ b/src/app/party-modification-creation/contract/payment-institution/payment-institution-ref.component.ts
@@ -5,8 +5,11 @@ import sortBy from 'lodash-es/sortBy';
import { Observable } from 'rxjs';
import get from 'lodash-es/get';
-import { PaymentInstitutionObject, PaymentInstitutionRef } from '../../../gen-damsel/domain';
-import { DomainTypedManager } from '../../../thrift';
+import {
+ PaymentInstitutionObject,
+ PaymentInstitutionRef
+} from '../../../thrift-services/damsel/gen-model/domain';
+import { DomainTypedManager } from '../../../thrift-services';
@Component({
selector: 'cc-payment-institution-ref',
diff --git a/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts b/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts
index 42c9b895..21dee5bb 100644
--- a/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-account.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import get from 'lodash-es/get';
-import { InternationalBankAccount } from '../../../../gen-damsel/domain';
+import { InternationalBankAccount } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-international-bank-account',
diff --git a/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts b/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts
index beb4b89b..361b61f6 100644
--- a/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-info/international-bank-account/international-bank-details/international-bank-details.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import get from 'lodash-es/get';
-import { InternationalBankDetails } from '../../../../../gen-damsel/domain';
+import { InternationalBankDetails } from '../../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-international-bank-details',
diff --git a/src/app/party-modification-creation/contract/payout-tool-info/payout-tool-info.component.ts b/src/app/party-modification-creation/contract/payout-tool-info/payout-tool-info.component.ts
index 900eb70e..85bda5ea 100644
--- a/src/app/party-modification-creation/contract/payout-tool-info/payout-tool-info.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-info/payout-tool-info.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { PayoutToolInfo } from '../../../gen-damsel/domain';
+import { PayoutToolInfo } from '../../../thrift-services/damsel/gen-model/domain';
import get from 'lodash-es/get';
enum Type {
diff --git a/src/app/party-modification-creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts b/src/app/party-modification-creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts
index 0ea651ce..c8b229f2 100644
--- a/src/app/party-modification-creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-info/russian-bank-account/russian-bank-account.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import get from 'lodash-es/get';
-import { RussianBankAccount } from '../../../../gen-damsel/domain';
+import { RussianBankAccount } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-russian-bank-account',
diff --git a/src/app/party-modification-creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts b/src/app/party-modification-creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts
index 246e0fdc..7d139425 100644
--- a/src/app/party-modification-creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-modification-unit/payout-tool-modification-unit.component.ts
@@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import * as uuid from 'uuid/v4';
import get from 'lodash-es/get';
-import { PayoutToolModificationUnit } from '../../../gen-damsel/payment_processing';
+import { PayoutToolModificationUnit } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-contract-payout-tool-modification-unit',
diff --git a/src/app/party-modification-creation/contract/payout-tool-modification/payout-tool-modification.component.ts b/src/app/party-modification-creation/contract/payout-tool-modification/payout-tool-modification.component.ts
index cd53846c..a0eceb9f 100644
--- a/src/app/party-modification-creation/contract/payout-tool-modification/payout-tool-modification.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-modification/payout-tool-modification.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import get from 'lodash-es/get';
-import { PayoutToolModification } from '../../../gen-damsel/payment_processing';
+import { PayoutToolModification } from '../../../thrift-services/damsel/gen-model/payment_processing';
enum Type {
creation = 'creation',
diff --git a/src/app/party-modification-creation/contract/payout-tool-params/payout-tool-params.component.ts b/src/app/party-modification-creation/contract/payout-tool-params/payout-tool-params.component.ts
index 26c6a078..a6c5bfca 100644
--- a/src/app/party-modification-creation/contract/payout-tool-params/payout-tool-params.component.ts
+++ b/src/app/party-modification-creation/contract/payout-tool-params/payout-tool-params.component.ts
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { PayoutToolInfo } from '../../../gen-damsel/domain';
+import { PayoutToolInfo } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-payout-tool-params',
diff --git a/src/app/party-modification-creation/contract/report-preferences/report-preferences.component.ts b/src/app/party-modification-creation/contract/report-preferences/report-preferences.component.ts
index a3e93cde..b2e6ef9a 100644
--- a/src/app/party-modification-creation/contract/report-preferences/report-preferences.component.ts
+++ b/src/app/party-modification-creation/contract/report-preferences/report-preferences.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { ReportPreferences } from '../../../gen-damsel/domain';
+import { ReportPreferences } from '../../../thrift-services/damsel/gen-model/domain';
import get from 'lodash-es/get';
@Component({
diff --git a/src/app/party-modification-creation/contract/representative-document/representative-document.component.ts b/src/app/party-modification-creation/contract/representative-document/representative-document.component.ts
index 4e3a900c..747cdc24 100644
--- a/src/app/party-modification-creation/contract/representative-document/representative-document.component.ts
+++ b/src/app/party-modification-creation/contract/representative-document/representative-document.component.ts
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
-import { RepresentativeDocument } from '../../../gen-damsel/domain';
+import { RepresentativeDocument } from '../../../thrift-services/damsel/gen-model/domain';
import get from 'lodash-es/get';
enum Type {
diff --git a/src/app/party-modification-creation/contract/representative/representative.component.ts b/src/app/party-modification-creation/contract/representative/representative.component.ts
index d9c5ff36..01a8a9a3 100644
--- a/src/app/party-modification-creation/contract/representative/representative.component.ts
+++ b/src/app/party-modification-creation/contract/representative/representative.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import get from 'lodash-es/get';
-import { Representative } from '../../../gen-damsel/domain';
+import { Representative } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-representative',
diff --git a/src/app/party-modification-creation/contract/termination/termination.component.ts b/src/app/party-modification-creation/contract/termination/termination.component.ts
index 8f69b58e..23f5c71d 100644
--- a/src/app/party-modification-creation/contract/termination/termination.component.ts
+++ b/src/app/party-modification-creation/contract/termination/termination.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import get from 'lodash-es/get';
-import { ContractTermination } from '../../../gen-damsel/payment_processing';
+import { ContractTermination } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-termination',
diff --git a/src/app/party-modification-creation/party-modification-creation.component.ts b/src/app/party-modification-creation/party-modification-creation.component.ts
index 99a08ab7..3f1a4ba1 100644
--- a/src/app/party-modification-creation/party-modification-creation.component.ts
+++ b/src/app/party-modification-creation/party-modification-creation.component.ts
@@ -17,7 +17,7 @@ import {
ContractModification,
PartyModification,
ShopModification
-} from '../gen-damsel/payment_processing';
+} from '../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-party-modification-creation',
diff --git a/src/app/party-modification-creation/shop/category-ref/category-ref.component.ts b/src/app/party-modification-creation/shop/category-ref/category-ref.component.ts
index ccf06a34..f63359b6 100644
--- a/src/app/party-modification-creation/shop/category-ref/category-ref.component.ts
+++ b/src/app/party-modification-creation/shop/category-ref/category-ref.component.ts
@@ -8,7 +8,7 @@ import { get } from 'lodash-es';
import { Category } from '../../../papi/model';
import { CategoryService } from '../../../papi/category.service';
-import { CategoryRef } from '../../../gen-damsel/domain';
+import { CategoryRef } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-category-ref',
diff --git a/src/app/party-modification-creation/shop/contract-modification/contract-modification.component.ts b/src/app/party-modification-creation/shop/contract-modification/contract-modification.component.ts
index 61f59ddc..fe932b93 100644
--- a/src/app/party-modification-creation/shop/contract-modification/contract-modification.component.ts
+++ b/src/app/party-modification-creation/shop/contract-modification/contract-modification.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { get } from 'lodash-es';
-import { ShopContractModification } from '../../../gen-damsel/payment_processing';
+import { ShopContractModification } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-shop-contract-modification',
diff --git a/src/app/party-modification-creation/shop/location-modification/shop-location.component.ts b/src/app/party-modification-creation/shop/location-modification/shop-location.component.ts
index 83b8c739..124ae663 100644
--- a/src/app/party-modification-creation/shop/location-modification/shop-location.component.ts
+++ b/src/app/party-modification-creation/shop/location-modification/shop-location.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnChanges } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { get } from 'lodash-es';
-import { ShopLocation } from '../../../gen-damsel/domain';
+import { ShopLocation } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-shop-location',
diff --git a/src/app/party-modification-creation/shop/payout-tool-modification/payout-tool-modification.component.ts b/src/app/party-modification-creation/shop/payout-tool-modification/payout-tool-modification.component.ts
index 8af674cf..00cf5ef6 100644
--- a/src/app/party-modification-creation/shop/payout-tool-modification/payout-tool-modification.component.ts
+++ b/src/app/party-modification-creation/shop/payout-tool-modification/payout-tool-modification.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { get } from 'lodash-es';
-import { PayoutToolID } from '../../../gen-damsel/domain';
+import { PayoutToolID } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-shop-payout-tool-modification',
diff --git a/src/app/party-modification-creation/shop/shop-account-creation/shop-account-creation.component.ts b/src/app/party-modification-creation/shop/shop-account-creation/shop-account-creation.component.ts
index 1b995890..7e112845 100644
--- a/src/app/party-modification-creation/shop/shop-account-creation/shop-account-creation.component.ts
+++ b/src/app/party-modification-creation/shop/shop-account-creation/shop-account-creation.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { get } from 'lodash-es';
-import { ShopAccountParams } from '../../../gen-damsel/payment_processing';
+import { ShopAccountParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-shop-account-creation',
diff --git a/src/app/party-modification-creation/shop/shop-details/shop-details.component.ts b/src/app/party-modification-creation/shop/shop-details/shop-details.component.ts
index c3bdb938..256d077e 100644
--- a/src/app/party-modification-creation/shop/shop-details/shop-details.component.ts
+++ b/src/app/party-modification-creation/shop/shop-details/shop-details.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { get } from 'lodash-es';
-import { ShopDetails } from '../../../gen-damsel/domain';
+import { ShopDetails } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-shop-details',
diff --git a/src/app/party-modification-creation/shop/shop-params/shop-params.component.ts b/src/app/party-modification-creation/shop/shop-params/shop-params.component.ts
index a1017e76..47f7c76a 100644
--- a/src/app/party-modification-creation/shop/shop-params/shop-params.component.ts
+++ b/src/app/party-modification-creation/shop/shop-params/shop-params.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { get } from 'lodash-es';
-import { ShopParams } from '../../../gen-damsel/payment_processing';
+import { ShopParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-shop-params',
diff --git a/src/app/party-modification-creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts b/src/app/party-modification-creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts
index f1aa5351..4d1b06ca 100644
--- a/src/app/party-modification-creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts
+++ b/src/app/party-modification-creation/shop/shop-payout-schedule-modification/shop-payout-schedule-modification.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { get } from 'lodash-es';
-import { ScheduleModification } from '../../../gen-damsel/payment_processing';
+import { ScheduleModification } from '../../../thrift-services/damsel/gen-model/payment_processing';
@Component({
selector: 'cc-shop-schedule-modification',
diff --git a/src/app/party-modification-target/party-target/party-target.service.ts b/src/app/party-modification-target/party-target/party-target.service.ts
index 34633a09..75da22d7 100644
--- a/src/app/party-modification-target/party-target/party-target.service.ts
+++ b/src/app/party-modification-target/party-target/party-target.service.ts
@@ -5,7 +5,7 @@ import { map } from 'rxjs/internal/operators';
import { PartyService } from '../../papi/party.service';
import { SelectableItem } from './selectable-item';
import { PartyTarget } from '../party-target';
-import { Contract, Contractor, Party, Shop } from '../../gen-damsel/domain';
+import { Contract, Contractor, Party, Shop } from '../../thrift-services/damsel/gen-model/domain';
@Injectable()
export class PartyTargetService {
diff --git a/src/app/party-modification-target/party-target/selectable-item.ts b/src/app/party-modification-target/party-target/selectable-item.ts
index a3d742d5..c2f2a0db 100644
--- a/src/app/party-modification-target/party-target/selectable-item.ts
+++ b/src/app/party-modification-target/party-target/selectable-item.ts
@@ -1,4 +1,4 @@
-import { Contract, Shop, Contractor } from '../../gen-damsel/domain';
+import { Contract, Shop, Contractor } from '../../thrift-services/damsel/gen-model/domain';
export class SelectableItem {
id: string;
diff --git a/src/app/party/party-details/party-details.component.ts b/src/app/party/party-details/party-details.component.ts
index 4974f1ad..a960173d 100644
--- a/src/app/party/party-details/party-details.component.ts
+++ b/src/app/party/party-details/party-details.component.ts
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { combineLatest } from 'rxjs';
-import { Party, Shop } from '../../gen-damsel/domain';
+import { Party, Shop } from '../../thrift-services/damsel/gen-model/domain';
import { PartyService } from '../party.service';
@Component({
diff --git a/src/app/party/party-details/party-info/party-info.component.ts b/src/app/party/party-details/party-info/party-info.component.ts
index b356f267..2662c32b 100644
--- a/src/app/party/party-details/party-info/party-info.component.ts
+++ b/src/app/party/party-details/party-info/party-info.component.ts
@@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
-import { Party } from '../../../gen-damsel/domain';
+import { Party } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-party-info',
diff --git a/src/app/party/party-details/shops-table/shops-table.component.ts b/src/app/party/party-details/shops-table/shops-table.component.ts
index e8e02ce3..57259d00 100644
--- a/src/app/party/party-details/shops-table/shops-table.component.ts
+++ b/src/app/party/party-details/shops-table/shops-table.component.ts
@@ -1,8 +1,8 @@
-import { Component, Input, OnChanges, ViewChild, SimpleChanges } from '@angular/core';
+import { Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
import { MatPaginator, MatTableDataSource } from '@angular/material';
import { ActivatedRoute, Router } from '@angular/router';
-import { Shop } from '../../../gen-damsel/domain';
+import { Shop } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-shops-table',
diff --git a/src/app/party/party.service.ts b/src/app/party/party.service.ts
index abe98fd8..4fc0c676 100644
--- a/src/app/party/party.service.ts
+++ b/src/app/party/party.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
-import { Contract, Party, PayoutTool, Shop } from '../gen-damsel/domain';
+import { Contract, Party, PayoutTool, Shop } from '../thrift-services/damsel/gen-model/domain';
import { PartyService as PapiPartyService } from '../papi/party.service';
import { map, tap } from 'rxjs/operators';
diff --git a/src/app/party/shop-details/add-provider/add-provider.component.ts b/src/app/party/shop-details/add-provider/add-provider.component.ts
index 807d2dfa..5dfd8821 100644
--- a/src/app/party/shop-details/add-provider/add-provider.component.ts
+++ b/src/app/party/shop-details/add-provider/add-provider.component.ts
@@ -4,7 +4,7 @@ import { FormGroup } from '@angular/forms';
import { Observable } from 'rxjs';
import { AddProviderService } from './add-provider.service';
-import { ProviderObject, TerminalObject } from '../../../gen-damsel/domain';
+import { ProviderObject, TerminalObject } from '../../../thrift-services/damsel/gen-model/domain';
interface AddProviderData {
partyID: string;
diff --git a/src/app/party/shop-details/add-provider/add-provider.service.ts b/src/app/party/shop-details/add-provider/add-provider.service.ts
index 0347291c..4cebf3ba 100644
--- a/src/app/party/shop-details/add-provider/add-provider.service.ts
+++ b/src/app/party/shop-details/add-provider/add-provider.service.ts
@@ -7,9 +7,9 @@ import {
AddDecisionToProvider,
DomainTypedManager,
filterProvidersByTerminalSelector
-} from '../../../thrift';
-import { ProviderObject, TerminalObject } from '../../../gen-damsel/domain';
-import { filterProvidersByCategoryId } from '../../../thrift/filters';
+} from '../../../thrift-services';
+import { ProviderObject, TerminalObject } from '../../../thrift-services/damsel/gen-model/domain';
+import { filterProvidersByCategoryId } from '../../../thrift-services/filters';
@Injectable()
export class AddProviderService {
diff --git a/src/app/party/shop-details/add-provider/select-provider/select-provider.component.ts b/src/app/party/shop-details/add-provider/select-provider/select-provider.component.ts
index aa01da16..a86808d9 100644
--- a/src/app/party/shop-details/add-provider/select-provider/select-provider.component.ts
+++ b/src/app/party/shop-details/add-provider/select-provider/select-provider.component.ts
@@ -11,7 +11,7 @@ import {
import { MatPaginator, MatTableDataSource } from '@angular/material';
import { SelectionModel } from '@angular/cdk/collections';
-import { ProviderObject } from '../../../../gen-damsel/domain';
+import { ProviderObject } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-select-provider',
diff --git a/src/app/party/shop-details/add-provider/select-terminal/create-terminal-form/create-terminal-form.service.ts b/src/app/party/shop-details/add-provider/select-terminal/create-terminal-form/create-terminal-form.service.ts
index 9eb0efcf..054562c8 100644
--- a/src/app/party/shop-details/add-provider/select-terminal/create-terminal-form/create-terminal-form.service.ts
+++ b/src/app/party/shop-details/add-provider/select-terminal/create-terminal-form/create-terminal-form.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
-import { DomainTypedManager, TerminalOption } from '../../../../../thrift';
+import { DomainTypedManager, TerminalOption } from '../../../../../thrift-services';
import { Observable } from 'rxjs';
const toFormArray = (fb: FormBuilder, options: TerminalOption[]): FormArray =>
diff --git a/src/app/party/shop-details/add-provider/select-terminal/select-terminal.component.ts b/src/app/party/shop-details/add-provider/select-terminal/select-terminal.component.ts
index 6ca7332c..3a67aea2 100644
--- a/src/app/party/shop-details/add-provider/select-terminal/select-terminal.component.ts
+++ b/src/app/party/shop-details/add-provider/select-terminal/select-terminal.component.ts
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
-import { TerminalObject } from '../../../../gen-damsel/domain';
+import { TerminalObject } from '../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-select-terminal',
diff --git a/src/app/party/shop-details/add-provider/select-terminal/terminals-table/terminals-table.component.ts b/src/app/party/shop-details/add-provider/select-terminal/terminals-table/terminals-table.component.ts
index 9a3ac489..b30b126b 100644
--- a/src/app/party/shop-details/add-provider/select-terminal/terminals-table/terminals-table.component.ts
+++ b/src/app/party/shop-details/add-provider/select-terminal/terminals-table/terminals-table.component.ts
@@ -11,7 +11,7 @@ import {
import { MatPaginator, MatTableDataSource } from '@angular/material';
import { SelectionModel } from '@angular/cdk/collections';
-import { TerminalObject } from '../../../../../gen-damsel/domain';
+import { TerminalObject } from '../../../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-terminals-table',
diff --git a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-priority/edit-terminal-decision-priority.service.ts b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-priority/edit-terminal-decision-priority.service.ts
index 58de25b5..09b50bd0 100644
--- a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-priority/edit-terminal-decision-priority.service.ts
+++ b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-priority/edit-terminal-decision-priority.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatSnackBar } from '@angular/material';
-import { DomainTypedManager } from '../../../../thrift';
+import { DomainTypedManager } from '../../../../thrift-services';
import { EditTerminalDecision } from '../edit-terminal-decision';
@Injectable()
diff --git a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-weight/edit-terminal-decision-weight.service.ts b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-weight/edit-terminal-decision-weight.service.ts
index da518668..6af6d4ff 100644
--- a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-weight/edit-terminal-decision-weight.service.ts
+++ b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision-weight/edit-terminal-decision-weight.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatSnackBar } from '@angular/material';
-import { DomainTypedManager } from '../../../../thrift';
+import { DomainTypedManager } from '../../../../thrift-services';
import { EditTerminalDecision } from '../edit-terminal-decision';
@Injectable()
diff --git a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision.ts b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision.ts
index 8dd6e30b..f7286230 100644
--- a/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision.ts
+++ b/src/app/party/shop-details/edit-terminal-decision/edit-terminal-decision.ts
@@ -3,8 +3,8 @@ import { MatSnackBar } from '@angular/material';
import { EventEmitter } from '@angular/core';
import { Subject } from 'rxjs';
-import { DomainTypedManager } from '../../../thrift';
-import { EditTerminalDecisionPropertyParams } from '../../../thrift/operations/edit-terminal-decision-property-params';
+import { DomainTypedManager } from '../../../thrift-services';
+import { EditTerminalDecisionPropertyParams } from '../../../thrift-services/damsel/operations/edit-terminal-decision-property-params';
import { EditPriorityData } from './edit-terminal-decision-priority/edit-terminal-decision-priority.component';
export interface EditTerminalDecisionFormValues {
diff --git a/src/app/party/shop-details/extract-terminal-info.ts b/src/app/party/shop-details/extract-terminal-info.ts
index 568bef6a..c1103537 100644
--- a/src/app/party/shop-details/extract-terminal-info.ts
+++ b/src/app/party/shop-details/extract-terminal-info.ts
@@ -1,7 +1,12 @@
import get from 'lodash-es/get';
import Int64 from 'thrift-ts/lib/int64';
-import { Condition, Predicate, TerminalObject, TerminalRef } from '../../gen-damsel/domain';
+import {
+ Condition,
+ Predicate,
+ TerminalObject,
+ TerminalRef
+} from '../../thrift-services/damsel/gen-model/domain';
interface PredicateInfo {
shopPartyContain: boolean;
diff --git a/src/app/party/shop-details/shop-details.component.ts b/src/app/party/shop-details/shop-details.component.ts
index 28db9457..82b43ba4 100644
--- a/src/app/party/shop-details/shop-details.component.ts
+++ b/src/app/party/shop-details/shop-details.component.ts
@@ -3,8 +3,8 @@ import { ActivatedRoute } from '@angular/router';
import { filter, switchMap } from 'rxjs/operators';
import { MatDialog } from '@angular/material';
-import { ShopDetailsService, ProviderInfo } from './shop-details.service';
-import { Contract, PayoutTool, Shop } from '../../gen-damsel/domain';
+import { ProviderInfo, ShopDetailsService } from './shop-details.service';
+import { Contract, PayoutTool, Shop } from '../../thrift-services/damsel/gen-model/domain';
import { AddProviderComponent } from './add-provider/add-provider.component';
@Component({
diff --git a/src/app/party/shop-details/shop-details.service.ts b/src/app/party/shop-details/shop-details.service.ts
index b8962e5e..656be09c 100644
--- a/src/app/party/shop-details/shop-details.service.ts
+++ b/src/app/party/shop-details/shop-details.service.ts
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
-import { Observable, combineLatest } from 'rxjs';
+import { combineLatest, Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import get from 'lodash-es/get';
@@ -9,10 +9,10 @@ import {
ProviderObject,
Shop,
TerminalObject
-} from '../../gen-damsel/domain';
+} from '../../thrift-services/damsel/gen-model/domain';
import { extractTerminalInfo, TerminalInfo } from './extract-terminal-info';
import { PartyService } from '../party.service';
-import { DomainTypedManager } from '../../thrift';
+import { DomainTypedManager } from '../../thrift-services';
export interface ProviderInfo {
provider: ProviderObject;
diff --git a/src/app/party/shop-details/shop-info/category/category.component.ts b/src/app/party/shop-details/shop-info/category/category.component.ts
index d52200c7..f9b52b62 100644
--- a/src/app/party/shop-details/shop-info/category/category.component.ts
+++ b/src/app/party/shop-details/shop-info/category/category.component.ts
@@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
-import { Category } from '../../../../gen-damsel/domain';
+import { Category } from '../../../../thrift-services/damsel/gen-model/domain';
import { CategoryService } from '../../../../papi/category.service';
@Component({
diff --git a/src/app/party/shop-details/shop-info/shop-blocking.pipe.ts b/src/app/party/shop-details/shop-info/shop-blocking.pipe.ts
index 3847ffcf..e7e27844 100644
--- a/src/app/party/shop-details/shop-info/shop-blocking.pipe.ts
+++ b/src/app/party/shop-details/shop-info/shop-blocking.pipe.ts
@@ -1,6 +1,6 @@
import { Pipe, PipeTransform } from '@angular/core';
-import { Blocking } from '../../../gen-damsel/domain';
+import { Blocking } from '../../../thrift-services/damsel/gen-model/domain';
@Pipe({
name: 'ccBlockingPipe'
diff --git a/src/app/party/shop-details/shop-info/shop-info.component.ts b/src/app/party/shop-details/shop-info/shop-info.component.ts
index 65faa911..5d076890 100644
--- a/src/app/party/shop-details/shop-info/shop-info.component.ts
+++ b/src/app/party/shop-details/shop-info/shop-info.component.ts
@@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core';
-import { Shop } from '../../../gen-damsel/domain';
+import { Shop } from '../../../thrift-services/damsel/gen-model/domain';
@Component({
selector: 'cc-shop-info',
diff --git a/src/app/party/shop-details/shop-info/shop-suspension.pipe.ts b/src/app/party/shop-details/shop-info/shop-suspension.pipe.ts
index 6c7afb52..759c04e3 100644
--- a/src/app/party/shop-details/shop-info/shop-suspension.pipe.ts
+++ b/src/app/party/shop-details/shop-info/shop-suspension.pipe.ts
@@ -1,6 +1,6 @@
import { Pipe, PipeTransform } from '@angular/core';
-import { Suspension } from '../../../gen-damsel/domain';
+import { Suspension } from '../../../thrift-services/damsel/gen-model/domain';
@Pipe({
name: 'ccSuspensionPipe'
diff --git a/src/app/party/shop-details/terminal/terminal.component.ts b/src/app/party/shop-details/terminal/terminal.component.ts
index af4780b6..d97b056d 100644
--- a/src/app/party/shop-details/terminal/terminal.component.ts
+++ b/src/app/party/shop-details/terminal/terminal.component.ts
@@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { MatSnackBar } from '@angular/material';
-import { DomainTypedManager } from '../../../thrift';
+import { DomainTypedManager } from '../../../thrift-services';
import { PredicateType, TerminalInfo } from '../extract-terminal-info';
@Component({
diff --git a/src/app/party/shop-details/terminals/terminals.component.ts b/src/app/party/shop-details/terminals/terminals.component.ts
index bdc8d403..ba3d3f08 100644
--- a/src/app/party/shop-details/terminals/terminals.component.ts
+++ b/src/app/party/shop-details/terminals/terminals.component.ts
@@ -10,7 +10,7 @@ import {
import { filter } from 'rxjs/operators';
import { MatDialog, MatSnackBar } from '@angular/material';
-import { DomainTypedManager } from '../../../thrift';
+import { DomainTypedManager } from '../../../thrift-services';
import { PredicateType, TerminalInfo } from '../extract-terminal-info';
import { EditTerminalDecisionPriorityComponent } from '../edit-terminal-decision/edit-terminal-decision-priority/edit-terminal-decision-priority.component';
import { EditTerminalDecisionWeightComponent } from '../edit-terminal-decision/edit-terminal-decision-weight/edit-terminal-decision-weight.component';
diff --git a/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-operation.service.ts b/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-operation.service.ts
index 45f56064..b1c6f6f3 100644
--- a/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-operation.service.ts
+++ b/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-operation.service.ts
@@ -4,7 +4,7 @@ import { catchError, map, tap } from 'rxjs/internal/operators';
import groupBy from 'lodash-es/groupBy';
import { ExecutorService } from '../executor.service';
-import { PaymentProcessingService } from '../../../thrift/payment-processing.service';
+import { PaymentProcessingService } from '../../../thrift-services/damsel/payment-processing.service';
import { AdjustmentOperationEvent, EventType } from './adjustment-event';
import { ExecResultGroup } from './exec-result-group';
diff --git a/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-params.ts b/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-params.ts
index 4383ba6a..b302a485 100644
--- a/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-params.ts
+++ b/src/app/payment-adjustment/create-and-capture/adjustment-operations/adjustment-params.ts
@@ -1,4 +1,7 @@
-import { InvoicePaymentAdjustmentParams, UserInfo } from '../../../gen-damsel/payment_processing';
+import {
+ InvoicePaymentAdjustmentParams,
+ UserInfo
+} from '../../../thrift-services/damsel/gen-model/payment_processing';
export interface PaymentAdjustmentCreationParams {
user: UserInfo;
diff --git a/src/app/payment-adjustment/create-and-capture/cancel-actions/cancel-actions.component.ts b/src/app/payment-adjustment/create-and-capture/cancel-actions/cancel-actions.component.ts
index 418b9b26..790bfe90 100644
--- a/src/app/payment-adjustment/create-and-capture/cancel-actions/cancel-actions.component.ts
+++ b/src/app/payment-adjustment/create-and-capture/cancel-actions/cancel-actions.component.ts
@@ -11,7 +11,7 @@ import {
OperationFailedPayload,
PaymentAdjustmentCancelParams
} from '../adjustment-operations';
-import { InvoicePaymentAdjustmentParams } from '../../../gen-damsel/payment_processing';
+import { InvoicePaymentAdjustmentParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
type FailedPayload = OperationFailedPayload;
diff --git a/src/app/payment-adjustment/create-and-capture/create-and-capture.component.ts b/src/app/payment-adjustment/create-and-capture/create-and-capture.component.ts
index 1710338c..4fc6fe61 100644
--- a/src/app/payment-adjustment/create-and-capture/create-and-capture.component.ts
+++ b/src/app/payment-adjustment/create-and-capture/create-and-capture.component.ts
@@ -4,8 +4,11 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Observable } from 'rxjs';
import { KeycloakService } from 'keycloak-angular';
-import { InvoicePaymentAdjustmentParams, UserInfo } from '../../gen-damsel/payment_processing';
-import { StatPayment } from '../../gen-damsel/merch_stat';
+import {
+ InvoicePaymentAdjustmentParams,
+ UserInfo
+} from '../../thrift-services/damsel/gen-model/payment_processing';
+import { StatPayment } from '../../thrift-services/damsel/gen-model/merch_stat';
import { ExecutorService } from './executor.service';
import {
CreateAdjustmentService,
diff --git a/src/app/payment-adjustment/payment-adjustment.component.ts b/src/app/payment-adjustment/payment-adjustment.component.ts
index 9917c482..5e01a426 100644
--- a/src/app/payment-adjustment/payment-adjustment.component.ts
+++ b/src/app/payment-adjustment/payment-adjustment.component.ts
@@ -3,7 +3,7 @@ import { MatDialog, MatSnackBar } from '@angular/material';
import { PaymentAdjustmentService } from './payment-adjustment.service';
import { CreateAndCaptureComponent } from './create-and-capture/create-and-capture.component';
-import { StatPayment } from '../gen-damsel/merch_stat';
+import { StatPayment } from '../thrift-services/damsel/gen-model/merch_stat';
import { SearchFormParams } from './search-form/search-form-params';
@Component({
diff --git a/src/app/payment-adjustment/payment-adjustment.module.ts b/src/app/payment-adjustment/payment-adjustment.module.ts
index d9120ac1..d0d87278 100644
--- a/src/app/payment-adjustment/payment-adjustment.module.ts
+++ b/src/app/payment-adjustment/payment-adjustment.module.ts
@@ -30,7 +30,7 @@ import { TableComponent } from './table/table.component';
import { SearchFormComponent } from './search-form/search-form.component';
import { PaymentAdjustmentService } from './payment-adjustment.service';
import { PapiModule } from '../papi/papi.module';
-import { ThriftModule } from '../thrift/thrift.module';
+import { DamselModule } from '../thrift-services/damsel/damsel.module';
import { ActionItemComponent } from './create-and-capture/action-item/action-item.component';
import { CreateActionsComponent } from './create-and-capture/create-actions/create-actions.component';
import { CancelActionsComponent } from './create-and-capture/cancel-actions/cancel-actions.component';
@@ -63,7 +63,7 @@ import { DomainModule } from '../domain';
MatExpansionModule,
MatProgressSpinnerModule,
PapiModule,
- ThriftModule,
+ DamselModule,
MatSelectModule,
DomainModule
],
diff --git a/src/app/payment-adjustment/payment-adjustment.service.ts b/src/app/payment-adjustment/payment-adjustment.service.ts
index 4fd31dda..5b968d71 100644
--- a/src/app/payment-adjustment/payment-adjustment.service.ts
+++ b/src/app/payment-adjustment/payment-adjustment.service.ts
@@ -3,8 +3,8 @@ import { Observable, of, Subject } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { SearchFormParams } from './search-form/search-form-params';
-import { MerchantStatisticsService } from '../thrift/merchant-statistics.service';
-import { StatPayment, StatResponse } from '../gen-damsel/merch_stat';
+import { MerchantStatisticsService } from '../thrift-services/damsel/merchant-statistics.service';
+import { StatPayment, StatResponse } from '../thrift-services/damsel/gen-model/merch_stat';
import { QueryDSL } from '../query-dsl';
import { DomainService } from '../domain';
diff --git a/src/app/payment-adjustment/table/table.component.ts b/src/app/payment-adjustment/table/table.component.ts
index b2535c3d..e25a012e 100644
--- a/src/app/payment-adjustment/table/table.component.ts
+++ b/src/app/payment-adjustment/table/table.component.ts
@@ -11,7 +11,7 @@ import {
import { SelectionModel } from '@angular/cdk/collections';
import { MatPaginator, MatTableDataSource } from '@angular/material';
-import { StatPayment } from '../../gen-damsel/merch_stat';
+import { StatPayment } from '../../thrift-services/damsel/gen-model/merch_stat';
import { i64ToNumber } from '../../shared/i64-to-number';
@Component({
diff --git a/src/app/query-dsl/deposit.ts b/src/app/query-dsl/deposit.ts
index 20a57f08..3be97b37 100644
--- a/src/app/query-dsl/deposit.ts
+++ b/src/app/query-dsl/deposit.ts
@@ -1,4 +1,4 @@
-import { DepositStatus } from '../fistful/gen-model/fistful_stat';
+import { DepositStatus } from '../thrift-services/fistful/gen-model/fistful_stat';
export interface Deposit {
amount_to?: number;
diff --git a/src/app/query-dsl/payment.ts b/src/app/query-dsl/payment.ts
index 7534091f..30d436d6 100644
--- a/src/app/query-dsl/payment.ts
+++ b/src/app/query-dsl/payment.ts
@@ -3,7 +3,7 @@ import {
InvoicePaymentStatus,
PaymentTool,
TerminalPaymentProvider
-} from '../gen-damsel/merch_stat';
+} from '../thrift-services/damsel/gen-model/merch_stat';
export interface Payment {
payment_id?: string;
diff --git a/src/app/repairing/repair-with-scenario/repair-wirh-scenario.component.ts b/src/app/repairing/repair-with-scenario/repair-wirh-scenario.component.ts
index 1805fed7..9c7604ba 100644
--- a/src/app/repairing/repair-with-scenario/repair-wirh-scenario.component.ts
+++ b/src/app/repairing/repair-with-scenario/repair-wirh-scenario.component.ts
@@ -9,7 +9,7 @@ import {
RepairWithScenarioSettingsComponent,
DialogData
} from './repair-with-scenario-settings/repair-with-scenario-settings.component';
-import { InvoiceRepairScenario } from '../../gen-damsel/payment_processing';
+import { InvoiceRepairScenario } from '../../thrift-services/damsel/gen-model/payment_processing';
import { RepairingStatusType } from '../repairing-status/repairing-status.component';
enum Status {
diff --git a/src/app/repairing/repair/repair.component.ts b/src/app/repairing/repair/repair.component.ts
index eaa4503e..f1ac38ec 100644
--- a/src/app/repairing/repair/repair.component.ts
+++ b/src/app/repairing/repair/repair.component.ts
@@ -6,7 +6,7 @@ import { SelectionModel } from '@angular/cdk/collections';
import { ExecStateType } from '../../shared/execute';
import { RepairingService } from '../repairing.service';
import { RepairSettingsComponent, DialogData } from './repair-settings/repair-settings.component';
-import { RepairScenario } from '../../fistful/gen-model/withdrawal_session';
+import { RepairScenario } from '../../thrift-services/fistful/gen-model/withdrawal_session';
import { RepairingStatusType } from '../repairing-status/repairing-status.component';
enum Status {
diff --git a/src/app/repairing/repairing.module.ts b/src/app/repairing/repairing.module.ts
index 9197ff1b..135a6707 100644
--- a/src/app/repairing/repairing.module.ts
+++ b/src/app/repairing/repairing.module.ts
@@ -25,10 +25,10 @@ import { RepairingComponent } from './repairing.component';
import { RepairingService } from './repairing.service';
import { RepairingRoutingModule } from './repairing-routing.module';
import { SharedModule } from '../shared/shared.module';
-import { MachinegunModule } from '../machinegun/machinegun.module';
+import { MachinegunModule } from '../thrift-services/machinegun/machinegun.module';
import { RepairWithScenarioComponent } from './repair-with-scenario/repair-wirh-scenario.component';
import { RepairWithScenarioSettingsComponent } from './repair-with-scenario/repair-with-scenario-settings/repair-with-scenario-settings.component';
-import { FistfulModule } from '../fistful/fistful.module';
+import { FistfulModule } from '../thrift-services/fistful/fistful.module';
import { RepairComponent } from './repair/repair.component';
import { RepairSettingsComponent } from './repair/repair-settings/repair-settings.component';
import { AddIdsInputComponent } from './add-ids-input/add-ids-input.component';
diff --git a/src/app/repairing/repairing.service.ts b/src/app/repairing/repairing.service.ts
index 7b067080..1ef797b6 100644
--- a/src/app/repairing/repairing.service.ts
+++ b/src/app/repairing/repairing.service.ts
@@ -4,12 +4,15 @@ import { KeycloakService } from 'keycloak-angular';
import { Observable, BehaviorSubject } from 'rxjs';
import { map, tap } from 'rxjs/operators';
-import { UserInfo, InvoiceRepairScenario } from '../gen-damsel/payment_processing';
+import {
+ UserInfo,
+ InvoiceRepairScenario
+} from '../thrift-services/damsel/gen-model/payment_processing';
import { execute } from '../shared/execute';
-import { AutomatonService } from '../machinegun/automaton.service';
-import { PaymentProcessingService } from '../thrift/payment-processing.service';
-import { RepairerService } from '../fistful/repairer.service';
-import { RepairScenario } from '../fistful/gen-model/withdrawal_session';
+import { AutomatonService } from '../thrift-services/machinegun/automaton.service';
+import { PaymentProcessingService } from '../thrift-services/damsel/payment-processing.service';
+import { RepairerService } from '../thrift-services/fistful/repairer.service';
+import { RepairScenario } from '../thrift-services/fistful/gen-model/withdrawal_session';
@Injectable()
export class RepairingService {
diff --git a/src/app/repairing/simple-repair/simple-repair.component.ts b/src/app/repairing/simple-repair/simple-repair.component.ts
index aa77b9d8..cc21c592 100644
--- a/src/app/repairing/simple-repair/simple-repair.component.ts
+++ b/src/app/repairing/simple-repair/simple-repair.component.ts
@@ -4,8 +4,8 @@ import { Observable } from 'rxjs';
import { SelectionModel } from '@angular/cdk/collections';
import { ExecStateType } from '../../shared/execute';
-import { Machine } from '../../machinegun/gen-model/state_processing';
-import { Namespace } from '../../machinegun/model/namespace';
+import { Machine } from '../../thrift-services/machinegun/gen-model/state_processing';
+import { Namespace } from '../../thrift-services/machinegun/model/namespace';
import { RepairingService } from '../repairing.service';
import { RepairingStatusType } from '../repairing-status/repairing-status.component';
diff --git a/src/app/shared/components/timeline/index.ts b/src/app/shared/components/timeline/index.ts
new file mode 100644
index 00000000..7766465d
--- /dev/null
+++ b/src/app/shared/components/timeline/index.ts
@@ -0,0 +1 @@
+export * from './timeline.module';
diff --git a/src/app/shared/components/timeline/timeline-item/index.ts b/src/app/shared/components/timeline/timeline-item/index.ts
new file mode 100644
index 00000000..f729af70
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/index.ts
@@ -0,0 +1 @@
+export * from './timeline-item.component';
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-badge/index.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/index.ts
new file mode 100644
index 00000000..c6cded53
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/index.ts
@@ -0,0 +1 @@
+export * from './timeline-item-badge.component';
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.html b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.html
new file mode 100644
index 00000000..29e716b4
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.html
@@ -0,0 +1,7 @@
+
+
+
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.scss b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.scss
new file mode 100644
index 00000000..207a09d9
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.scss
@@ -0,0 +1,31 @@
+@import '../timeline-item.scss';
+@import '../../../../styles/light';
+
+$size: 36px;
+$line-size: 2px;
+
+$neutral: map-get($theme, neutral);
+$line-color: mat-color($neutral, 200);
+.cc-timeline-item-badge {
+ position: absolute;
+ left: 0;
+ top: 0;
+ display: flex;
+ height: $size;
+ width: $size;
+ justify-content: center;
+ align-items: center;
+ border-radius: 50%;
+ z-index: 10;
+
+ ::ng-deep > *,
+ ::ng-deep > * mat-icon {
+ height: $icons-size;
+ width: $icons-size;
+ font-size: $icons-size;
+ }
+}
+
+.cc-timeline-item-badge {
+ background-color: $line-color;
+}
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.ts
new file mode 100644
index 00000000..047c62b0
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-badge/timeline-item-badge.component.ts
@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'cc-timeline-item-badge',
+ templateUrl: 'timeline-item-badge.component.html',
+ styleUrls: ['timeline-item-badge.component.scss']
+})
+export class TimelineItemBadgeComponent {}
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-content/index.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-content/index.ts
new file mode 100644
index 00000000..43222f07
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-content/index.ts
@@ -0,0 +1 @@
+export * from './timeline-item-content.component';
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.scss b/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.scss
new file mode 100644
index 00000000..c3208083
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.scss
@@ -0,0 +1,5 @@
+@import '../timeline-item.scss';
+
+.cc-timeline-item-content {
+ padding-top: $content-padding;
+}
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.ts
new file mode 100644
index 00000000..75b6cdc1
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-content/timeline-item-content.component.ts
@@ -0,0 +1,11 @@
+import { Component, ViewEncapsulation, HostBinding } from '@angular/core';
+
+@Component({
+ selector: 'cc-timeline-item-content, [cc-timeline-item-content]',
+ template: '',
+ styleUrls: ['timeline-item-content.component.scss'],
+ encapsulation: ViewEncapsulation.None
+})
+export class TimelineItemContentComponent {
+ @HostBinding('class.cc-timeline-item-content') rootClass = true;
+}
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-title/index.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-title/index.ts
new file mode 100644
index 00000000..16584b67
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-title/index.ts
@@ -0,0 +1 @@
+export * from './timeline-item-title.component';
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.html b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.html
new file mode 100644
index 00000000..d521d399
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.html
@@ -0,0 +1,3 @@
+
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.scss b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.scss
new file mode 100644
index 00000000..57678938
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.scss
@@ -0,0 +1,7 @@
+@import '../timeline-item.scss';
+
+.cc-timeline-item-title {
+ min-height: $size;
+ display: flex;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.ts b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.ts
new file mode 100644
index 00000000..37b5a2cf
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item-title/timeline-item-title.component.ts
@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'cc-timeline-item-title',
+ templateUrl: 'timeline-item-title.component.html',
+ styleUrls: ['timeline-item-title.component.scss']
+})
+export class TimelineItemTitleComponent {}
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item.component.html b/src/app/shared/components/timeline/timeline-item/timeline-item.component.html
new file mode 100644
index 00000000..ad181173
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item.component.html
@@ -0,0 +1 @@
+
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item.component.scss b/src/app/shared/components/timeline/timeline-item/timeline-item.component.scss
new file mode 100644
index 00000000..edf35dab
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item.component.scss
@@ -0,0 +1,7 @@
+@import './timeline-item.scss';
+
+.cc-timeline-item {
+ padding-bottom: 20px;
+ padding-left: $size + $content-padding;
+ position: relative;
+}
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item.component.ts b/src/app/shared/components/timeline/timeline-item/timeline-item.component.ts
new file mode 100644
index 00000000..7cabdbd5
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item.component.ts
@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'cc-timeline-item',
+ templateUrl: 'timeline-item.component.html',
+ styleUrls: ['timeline-item.component.scss']
+})
+export class TimelineItemComponent {}
diff --git a/src/app/shared/components/timeline/timeline-item/timeline-item.scss b/src/app/shared/components/timeline/timeline-item/timeline-item.scss
new file mode 100644
index 00000000..79d56a09
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline-item/timeline-item.scss
@@ -0,0 +1,4 @@
+$size: 36px;
+$icons-size: 18px;
+$line-size: 2px;
+$content-padding: 10px;
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline.component.html b/src/app/shared/components/timeline/timeline.component.html
new file mode 100644
index 00000000..48decabe
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline.component.html
@@ -0,0 +1 @@
+
diff --git a/src/app/shared/components/timeline/timeline.component.scss b/src/app/shared/components/timeline/timeline.component.scss
new file mode 100644
index 00000000..1a8de017
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline.component.scss
@@ -0,0 +1,24 @@
+@import '../../styles/light';
+
+$size: 36px;
+$line-size: 2px;
+
+$neutral: map-get($theme, neutral);
+$line-color: mat-color($neutral, 200);
+
+.cc-timeline {
+ position: relative;
+ border-bottom: $line-size solid;
+ border-bottom-color: $line-color;
+ font-family: Roboto, "Helvetica Neue", sans-serif;
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: $line-size;
+ left: $size / 2 - $line-size / 2;
+ background-color: $line-color;
+ }
+}
\ No newline at end of file
diff --git a/src/app/shared/components/timeline/timeline.component.ts b/src/app/shared/components/timeline/timeline.component.ts
new file mode 100644
index 00000000..e05b03d9
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline.component.ts
@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'cc-timeline',
+ templateUrl: 'timeline.component.html',
+ styleUrls: ['timeline.component.scss']
+})
+export class TimelineComponent {}
diff --git a/src/app/shared/components/timeline/timeline.module.ts b/src/app/shared/components/timeline/timeline.module.ts
new file mode 100644
index 00000000..2fe08000
--- /dev/null
+++ b/src/app/shared/components/timeline/timeline.module.ts
@@ -0,0 +1,24 @@
+import { NgModule } from '@angular/core';
+import { FlexLayoutModule } from '@angular/flex-layout';
+import { CommonModule } from '@angular/common';
+
+import { TimelineComponent } from './timeline.component';
+import { TimelineItemComponent } from './timeline-item';
+import { TimelineItemTitleComponent } from './timeline-item/timeline-item-title';
+import { TimelineItemBadgeComponent } from './timeline-item/timeline-item-badge';
+import { TimelineItemContentComponent } from './timeline-item/timeline-item-content';
+
+const EXPORTED_DECLARATIONS = [
+ TimelineComponent,
+ TimelineItemComponent,
+ TimelineItemTitleComponent,
+ TimelineItemBadgeComponent,
+ TimelineItemContentComponent
+];
+
+@NgModule({
+ imports: [FlexLayoutModule, CommonModule],
+ declarations: EXPORTED_DECLARATIONS,
+ exports: EXPORTED_DECLARATIONS
+})
+export class TimelineModule {}
diff --git a/src/app/shared/extract-claim-status.ts b/src/app/shared/extract-claim-status.ts
new file mode 100644
index 00000000..814c53d5
--- /dev/null
+++ b/src/app/shared/extract-claim-status.ts
@@ -0,0 +1,15 @@
+import { ClaimStatus as UnionClaimStatus } from '../thrift-services/damsel/gen-model/claim_management';
+import { ClaimStatus } from '../papi/model/claim-statuses';
+import { getUnionKey } from './get-union-key';
+
+export const claimStatusByUnionClaimStatus: { [name in keyof UnionClaimStatus]-?: ClaimStatus } = {
+ accepted: ClaimStatus.accepted,
+ denied: ClaimStatus.denied,
+ revoked: ClaimStatus.revoked,
+ pending: ClaimStatus.pending,
+ review: ClaimStatus.review,
+ pending_acceptance: ClaimStatus.pending_acceptance
+};
+
+export const extractClaimStatus = (status: UnionClaimStatus): ClaimStatus =>
+ claimStatusByUnionClaimStatus[getUnionKey(status) as keyof UnionClaimStatus];
diff --git a/src/app/shared/get-union-key.ts b/src/app/shared/get-union-key.ts
new file mode 100644
index 00000000..6752304a
--- /dev/null
+++ b/src/app/shared/get-union-key.ts
@@ -0,0 +1 @@
+export const getUnionKey = (union: any) => Object.entries(union).find(([, v]) => !!v)[0];
diff --git a/src/app/shared/humanize-duration/humanize-duration.module.ts b/src/app/shared/humanize-duration/humanize-duration.module.ts
new file mode 100644
index 00000000..63b4a17a
--- /dev/null
+++ b/src/app/shared/humanize-duration/humanize-duration.module.ts
@@ -0,0 +1,11 @@
+import { NgModule } from '@angular/core';
+
+import { HumanizedDurationPipe } from './humanized-duration.pipe';
+import { HumanizeDurationService } from './humanize-duration.service';
+
+@NgModule({
+ declarations: [HumanizedDurationPipe],
+ providers: [HumanizeDurationService],
+ exports: [HumanizedDurationPipe]
+})
+export class HumanizeDurationModule {}
diff --git a/src/app/shared/humanize-duration/humanize-duration.service.ts b/src/app/shared/humanize-duration/humanize-duration.service.ts
new file mode 100644
index 00000000..524c4337
--- /dev/null
+++ b/src/app/shared/humanize-duration/humanize-duration.service.ts
@@ -0,0 +1,70 @@
+import { Injectable } from '@angular/core';
+import * as humanizeDuration from 'humanize-duration';
+import * as moment from 'moment';
+
+export type Value = number | string | moment.Moment | Date;
+
+export interface HumanizeConfig extends humanizeDuration.HumanizerOptions {
+ isShort?: boolean;
+ hasAgoEnding?: boolean;
+}
+
+@Injectable()
+export class HumanizeDurationService {
+ static HOUR_MS = 3600000;
+ static MIN_HUMANIZE_DURATION_UPDATE_MS = 1000;
+ static MOMENT_HUMANIZE_ALLOWED_DELAY_BETWEEN_UPDATES_FOR_MINUTE_UPDATES_MS = 20000;
+ static MOMENT_HUMANIZE_ALLOWED_DELAY_BETWEEN_UPDATES_FOR_HOURLY_AND_LONGER_UPDATES_MS = 600000;
+ static LESS_THAN_FEW_SECONDS = 3000;
+
+ private get duration() {
+ return humanizeDuration.humanizer({
+ language: 'en',
+ round: true,
+ delimiter: ' '
+ });
+ }
+
+ get shortEnglishHumanizer(): humanizeDuration.HumanizerOptions {
+ return {
+ language: 'short'
+ };
+ }
+
+ getDiffMs(value: Value): number {
+ return Math.abs(this.isDiff(value) ? value : moment().diff(moment(value)));
+ }
+
+ getDuration(value: Value, config: HumanizeConfig = {}): string {
+ const diffMs = this.getDiffMs(value);
+ let duration = this.duration(diffMs, config);
+ if (isNaN(diffMs)) {
+ return null;
+ } else if (diffMs < HumanizeDurationService.LESS_THAN_FEW_SECONDS) {
+ return 'just now';
+ } else if (config.isShort) {
+ duration = this.duration(diffMs, { ...config, ...this.shortEnglishHumanizer });
+ } else if (config.largest === 1) {
+ duration = moment.duration(diffMs).humanize();
+ }
+ return config.hasAgoEnding ? `${duration} ago` : duration;
+ }
+
+ getOptimalUpdateInterval(value: Value, { largest }: HumanizeConfig): number {
+ const diffMs = this.getDiffMs(value);
+ if (diffMs < HumanizeDurationService.LESS_THAN_FEW_SECONDS) {
+ return HumanizeDurationService.MIN_HUMANIZE_DURATION_UPDATE_MS;
+ }
+ if (largest === 1) {
+ if (diffMs < HumanizeDurationService.HOUR_MS) {
+ return HumanizeDurationService.MOMENT_HUMANIZE_ALLOWED_DELAY_BETWEEN_UPDATES_FOR_MINUTE_UPDATES_MS;
+ }
+ return HumanizeDurationService.MOMENT_HUMANIZE_ALLOWED_DELAY_BETWEEN_UPDATES_FOR_HOURLY_AND_LONGER_UPDATES_MS;
+ }
+ return HumanizeDurationService.MIN_HUMANIZE_DURATION_UPDATE_MS;
+ }
+
+ isDiff(value: Value): value is number {
+ return typeof value === 'number';
+ }
+}
diff --git a/src/app/shared/humanize-duration/humanized-duration.pipe.ts b/src/app/shared/humanize-duration/humanized-duration.pipe.ts
new file mode 100644
index 00000000..4f0afe03
--- /dev/null
+++ b/src/app/shared/humanize-duration/humanized-duration.pipe.ts
@@ -0,0 +1,54 @@
+import { Pipe, PipeTransform, ChangeDetectorRef, OnDestroy } from '@angular/core';
+import { Subscription, interval } from 'rxjs';
+import { HumanizerOptions } from 'humanize-duration';
+
+import { HumanizeConfig, HumanizeDurationService, Value } from './humanize-duration.service';
+
+export interface HumanizeDurationConfig extends HumanizeConfig {
+ interval?: number;
+}
+
+@Pipe({ name: 'humanizedDuration', pure: false })
+export class HumanizedDurationPipe implements OnDestroy, PipeTransform {
+ private latestValue: string;
+ private subscription: Subscription;
+ private inputValue: Value;
+
+ constructor(
+ private humanizeDurationService: HumanizeDurationService,
+ private ref: ChangeDetectorRef
+ ) {}
+
+ transform(value: Value, { interval: inpIntervalMs, ...config }: HumanizeDurationConfig = {}) {
+ if (value !== this.inputValue) {
+ this.inputValue = value;
+ this.latestValue = this.humanizeDurationService.getDuration(value, config);
+ this.dispose();
+ if (!this.humanizeDurationService.isDiff(value)) {
+ this.subscription = interval(
+ inpIntervalMs ||
+ this.humanizeDurationService.getOptimalUpdateInterval(value, config)
+ ).subscribe(() => this.updateValue(value, config));
+ }
+ }
+ return this.latestValue;
+ }
+
+ ngOnDestroy(): void {
+ this.dispose();
+ }
+
+ private dispose(): void {
+ if (this.subscription) {
+ this.subscription.unsubscribe();
+ }
+ }
+
+ private updateValue(value: Value, config: HumanizerOptions): void {
+ const duration = this.humanizeDurationService.getDuration(value, config);
+ if (duration !== this.latestValue) {
+ this.ref.markForCheck();
+ this.latestValue = duration;
+ }
+ }
+}
diff --git a/src/app/shared/humanize-duration/index.ts b/src/app/shared/humanize-duration/index.ts
new file mode 100644
index 00000000..2d44d136
--- /dev/null
+++ b/src/app/shared/humanize-duration/index.ts
@@ -0,0 +1,2 @@
+export * from './humanize-duration.module';
+export * from './humanize-duration.service';
diff --git a/src/app/shared/operators/boolean-debounce-time.ts b/src/app/shared/operators/boolean-debounce-time.ts
new file mode 100644
index 00000000..c48ac4b0
--- /dev/null
+++ b/src/app/shared/operators/boolean-debounce-time.ts
@@ -0,0 +1,11 @@
+import { distinctUntilChanged, debounce } from 'rxjs/operators';
+import { timer, empty, Observable } from 'rxjs';
+
+export const booleanDebounceTime = (timeoutMs: number = 500) => (
+ s: Observable
+): Observable =>
+ s.pipe(
+ distinctUntilChanged(),
+ debounce(v => (v ? timer(timeoutMs) : empty())),
+ distinctUntilChanged()
+ );
diff --git a/src/app/shared/operators/index.ts b/src/app/shared/operators/index.ts
new file mode 100644
index 00000000..48854a7a
--- /dev/null
+++ b/src/app/shared/operators/index.ts
@@ -0,0 +1 @@
+export * from './boolean-debounce-time';
diff --git a/src/app/shared/pipes/claim-status.pipe.ts b/src/app/shared/pipes/claim-status.pipe.ts
new file mode 100644
index 00000000..6d7be06b
--- /dev/null
+++ b/src/app/shared/pipes/claim-status.pipe.ts
@@ -0,0 +1,12 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+import { extractClaimStatus } from '../extract-claim-status';
+
+@Pipe({
+ name: 'ccClaimStatus'
+})
+export class ClaimStatusPipe implements PipeTransform {
+ transform(value: any): string {
+ return extractClaimStatus(value);
+ }
+}
diff --git a/src/app/shared/pipes/index.ts b/src/app/shared/pipes/index.ts
new file mode 100644
index 00000000..3b66b467
--- /dev/null
+++ b/src/app/shared/pipes/index.ts
@@ -0,0 +1,4 @@
+export * from './claim-status.pipe';
+export * from './currency.pipe';
+export * from './format-amount.pipe';
+export * from './thrift-view.pipe';
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index 1dfb16ce..472071ad 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -2,10 +2,8 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PrettyJsonModule } from 'angular2-prettyjson';
-import { CurrencyPipe } from './pipes/currency.pipe';
-import { FormatAmountPipe } from './pipes/format-amount.pipe';
+import { CurrencyPipe, FormatAmountPipe, ThriftViewPipe, ClaimStatusPipe } from './pipes';
import { ThriftInt64Pipe } from './thrift-int64.pipe';
-import { ThriftViewPipe } from './pipes/thrift-view.pipe';
import { PrettyJsonComponent } from './components/pretty-json/pretty-json.component';
import { CardContainerComponent } from './components/card-container/card-container.component';
@@ -14,6 +12,7 @@ const declarations = [
FormatAmountPipe,
ThriftInt64Pipe,
ThriftViewPipe,
+ ClaimStatusPipe,
PrettyJsonComponent,
CardContainerComponent
];
diff --git a/src/app/shared/styles/_fill.scss b/src/app/shared/styles/_fill.scss
new file mode 100644
index 00000000..95dead92
--- /dev/null
+++ b/src/app/shared/styles/_fill.scss
@@ -0,0 +1,7 @@
+@mixin fill($color) {
+ color: $color;
+
+ * {
+ fill: $color;
+ }
+}
\ No newline at end of file
diff --git a/src/app/shared/styles/light.scss b/src/app/shared/styles/light.scss
new file mode 100644
index 00000000..24d80aca
--- /dev/null
+++ b/src/app/shared/styles/light.scss
@@ -0,0 +1,6 @@
+@import '~@angular/material/theming';
+
+$theme: (
+ name: 'light',
+ neutral: mat-palette($mat-grey),
+);
\ No newline at end of file
diff --git a/src/app/shared/thrift-utils.ts b/src/app/shared/thrift-utils.ts
index 63531902..a62fad4f 100644
--- a/src/app/shared/thrift-utils.ts
+++ b/src/app/shared/thrift-utils.ts
@@ -1,4 +1,4 @@
-import { DomainObject } from '../gen-damsel/domain';
+import { DomainObject } from '../thrift-services/damsel/gen-model/domain';
export function clearNullFields(union: object): object {
if (!union) {
diff --git a/src/app/shared/utils/index.ts b/src/app/shared/utils/index.ts
new file mode 100644
index 00000000..fb868e1c
--- /dev/null
+++ b/src/app/shared/utils/index.ts
@@ -0,0 +1 @@
+export * from './sort-units';
diff --git a/src/app/shared/utils/sort-units.ts b/src/app/shared/utils/sort-units.ts
new file mode 100644
index 00000000..f510faad
--- /dev/null
+++ b/src/app/shared/utils/sort-units.ts
@@ -0,0 +1,5 @@
+import * as moment from 'moment';
+import { ModificationUnit } from '../../thrift-services/damsel/gen-model/claim_management';
+
+export const sortUnitsByCreatedAtAsc = (units: T[]): T[] =>
+ units.slice().sort(({ created_at: a }, { created_at: b }) => moment(a).diff(moment(b)));
diff --git a/src/app/thrift-services/ank/ank.module.ts b/src/app/thrift-services/ank/ank.module.ts
new file mode 100644
index 00000000..b90de270
--- /dev/null
+++ b/src/app/thrift-services/ank/ank.module.ts
@@ -0,0 +1,5 @@
+import { NgModule } from '@angular/core';
+import { AnkService } from './ank.service';
+
+@NgModule({ providers: [AnkService] })
+export class AnkModule {}
diff --git a/src/app/thrift-services/ank/ank.service.ts b/src/app/thrift-services/ank/ank.service.ts
new file mode 100644
index 00000000..9db8a219
--- /dev/null
+++ b/src/app/thrift-services/ank/ank.service.ts
@@ -0,0 +1,26 @@
+import { Injectable, NgZone } from '@angular/core';
+
+import { ThriftService } from '../thrift-service';
+import * as QuestionaryManager from './gen-nodejs/QuestionaryManager';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
+import {
+ Version,
+ QuestionaryParams,
+ QuestionaryID,
+ Snapshot
+} from './gen-model/questionary_manager';
+import { Observable } from 'rxjs';
+import { toGenReference } from '../converters';
+
+@Injectable()
+export class AnkService extends ThriftService {
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/questionary', QuestionaryManager);
+ }
+
+ save = (params: QuestionaryParams, version: Version): Observable =>
+ this.toObservableAction('Save')(params, version);
+
+ get = (questionaryId: QuestionaryID, reference = toGenReference()): Observable =>
+ this.toObservableAction('Get')(questionaryId, reference);
+}
diff --git a/src/app/thrift-services/ank/index.ts b/src/app/thrift-services/ank/index.ts
new file mode 100644
index 00000000..650eaebd
--- /dev/null
+++ b/src/app/thrift-services/ank/index.ts
@@ -0,0 +1 @@
+export * from './ank.module';
diff --git a/src/app/thrift/converters/index.ts b/src/app/thrift-services/converters/index.ts
similarity index 100%
rename from src/app/thrift/converters/index.ts
rename to src/app/thrift-services/converters/index.ts
diff --git a/src/app/thrift/converters/to-gen-commit.ts b/src/app/thrift-services/converters/to-gen-commit.ts
similarity index 92%
rename from src/app/thrift/converters/to-gen-commit.ts
rename to src/app/thrift-services/converters/to-gen-commit.ts
index 50d532be..2561f71e 100644
--- a/src/app/thrift/converters/to-gen-commit.ts
+++ b/src/app/thrift-services/converters/to-gen-commit.ts
@@ -1,5 +1,5 @@
-import * as DomainConfigTypes from '../gen-nodejs/domain_config_types';
-import { Commit, InsertOp, Operation, RemoveOp, UpdateOp } from '../../gen-damsel/domain_config';
+import * as DomainConfigTypes from '../damsel/gen-nodejs/domain_config_types';
+import { Commit, InsertOp, Operation, RemoveOp, UpdateOp } from '../damsel/gen-model/domain_config';
const toGenInsertOp = (insertOp: InsertOp) => {
const insertOpGen = new DomainConfigTypes.InsertOp();
diff --git a/src/app/thrift/converters/to-gen-domain-object.ts b/src/app/thrift-services/converters/to-gen-domain-object.ts
similarity index 75%
rename from src/app/thrift/converters/to-gen-domain-object.ts
rename to src/app/thrift-services/converters/to-gen-domain-object.ts
index 1150f5ef..563a0464 100644
--- a/src/app/thrift/converters/to-gen-domain-object.ts
+++ b/src/app/thrift-services/converters/to-gen-domain-object.ts
@@ -1,4 +1,4 @@
-import * as DomainTypes from '../gen-nodejs/domain_types';
+import * as DomainTypes from '../damsel/gen-nodejs/domain_types';
export const toGenDomainObject = (genObject: any, field: string) => {
const domainObjectGen = new DomainTypes.DomainObject();
diff --git a/src/app/thrift/converters/to-gen-reference.ts b/src/app/thrift-services/converters/to-gen-reference.ts
similarity index 79%
rename from src/app/thrift/converters/to-gen-reference.ts
rename to src/app/thrift-services/converters/to-gen-reference.ts
index 25341358..c49cfedf 100644
--- a/src/app/thrift/converters/to-gen-reference.ts
+++ b/src/app/thrift-services/converters/to-gen-reference.ts
@@ -1,5 +1,5 @@
-import * as DomainConfigTypes from '../gen-nodejs/domain_config_types';
-import { Reference, Version } from '../../gen-damsel/domain_config';
+import * as DomainConfigTypes from '../damsel/gen-nodejs/domain_config_types';
+import { Reference, Version } from '../damsel/gen-model/domain_config';
const toGenHead = () => {
const reference = new DomainConfigTypes.Reference();
diff --git a/src/app/thrift/converters/to-gen-terminal-decision.ts b/src/app/thrift-services/converters/to-gen-terminal-decision.ts
similarity index 93%
rename from src/app/thrift/converters/to-gen-terminal-decision.ts
rename to src/app/thrift-services/converters/to-gen-terminal-decision.ts
index f2188e3e..5bb1ee26 100644
--- a/src/app/thrift/converters/to-gen-terminal-decision.ts
+++ b/src/app/thrift-services/converters/to-gen-terminal-decision.ts
@@ -1,13 +1,13 @@
-import * as DomainTypes from '../gen-nodejs/domain_types';
+import * as DomainTypes from '../damsel/gen-nodejs/domain_types';
import {
- TerminalDecision,
- Predicate,
Condition,
PartyCondition,
PartyConditionDefinition,
- TerminalSelector,
- TerminalRef
-} from '../../gen-damsel/domain';
+ Predicate,
+ TerminalDecision,
+ TerminalRef,
+ TerminalSelector
+} from '../damsel/gen-model/domain';
const toPartyConditionDefinitionGen = (definition: PartyConditionDefinition) => {
const definitionGen = new DomainTypes.PartyConditionDefinition();
diff --git a/src/app/thrift/converters/to-gen-terminal-object.ts b/src/app/thrift-services/converters/to-gen-terminal-object.ts
similarity index 82%
rename from src/app/thrift/converters/to-gen-terminal-object.ts
rename to src/app/thrift-services/converters/to-gen-terminal-object.ts
index e121ec7f..394ae81b 100644
--- a/src/app/thrift/converters/to-gen-terminal-object.ts
+++ b/src/app/thrift-services/converters/to-gen-terminal-object.ts
@@ -1,5 +1,5 @@
-import * as DomainTypes from '../gen-nodejs/domain_types';
-import { Terminal, TerminalObject, TerminalRef } from '../../gen-damsel/domain';
+import * as DomainTypes from '../damsel/gen-nodejs/domain_types';
+import { Terminal, TerminalObject, TerminalRef } from '../damsel/gen-model/domain';
const toGenTerminalRef = (ref: TerminalRef) => {
const terminalRef = new DomainTypes.TerminalRef();
diff --git a/src/app/thrift-services/damsel/claim-management.service.ts b/src/app/thrift-services/damsel/claim-management.service.ts
new file mode 100644
index 00000000..4b47b45c
--- /dev/null
+++ b/src/app/thrift-services/damsel/claim-management.service.ts
@@ -0,0 +1,80 @@
+import { Injectable, NgZone } from '@angular/core';
+import { Observable } from 'rxjs';
+
+import { ThriftService } from '../thrift-service';
+import * as ClaimManagement from './gen-nodejs/ClaimManagement';
+import { Modification as ModificationType } from './gen-nodejs/claim_management_types';
+import { Modification } from './gen-model/claim_management';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
+import { ClaimSearchQuery as ClaimSearchQueryType } from './gen-nodejs/claim_management_types';
+import {
+ Claim,
+ ClaimID,
+ ClaimSearchQuery,
+ ClaimSearchResponse
+} from './gen-model/claim_management';
+import { switchMap } from 'rxjs/operators';
+
+@Injectable()
+export class ClaimManagementService extends ThriftService {
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/cm', ClaimManagement);
+ }
+
+ searchClaims = (query: ClaimSearchQuery): Observable =>
+ this.toObservableAction('SearchClaims')(new ClaimSearchQueryType(query));
+
+ getClaim = (partyID: string, claimID: ClaimID): Observable =>
+ this.toObservableAction('GetClaim')(partyID, claimID);
+
+ acceptClaim = (partyID: string, claimID: ClaimID): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('AcceptClaim')(partyID, claimID, claim.revision)
+ )
+ );
+
+ requestClaimReview = (partyID: string, claimID: ClaimID): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('RequestClaimReview')(partyID, claimID, claim.revision)
+ )
+ );
+
+ requestClaimChanges = (partyID: string, claimID: ClaimID): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('RequestClaimChanges')(partyID, claimID, claim.revision)
+ )
+ );
+
+ denyClaim = (partyID: string, claimID: ClaimID, reason: string): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('DenyClaim')(partyID, claimID, claim.revision, reason)
+ )
+ );
+
+ revokeClaim = (partyID: string, claimID: ClaimID, reason: string): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('RevokeClaim')(partyID, claimID, claim.revision, reason)
+ )
+ );
+
+ updateClaim = (
+ partyID: string,
+ claimID: ClaimID,
+ changeset: Modification[]
+ ): Observable =>
+ this.getClaim(partyID, claimID).pipe(
+ switchMap(claim =>
+ this.toObservableAction('UpdateClaim')(
+ claim.party_id,
+ claim.id,
+ claim.revision,
+ changeset.map(m => new ModificationType(m))
+ )
+ )
+ );
+}
diff --git a/src/app/thrift/thrift.module.ts b/src/app/thrift-services/damsel/damsel.module.ts
similarity index 76%
rename from src/app/thrift/thrift.module.ts
rename to src/app/thrift-services/damsel/damsel.module.ts
index 2bdf7d4c..0ce0d7c0 100644
--- a/src/app/thrift/thrift.module.ts
+++ b/src/app/thrift-services/damsel/damsel.module.ts
@@ -5,6 +5,7 @@ import { PaymentProcessingService } from './payment-processing.service';
import { MerchantStatisticsService } from './merchant-statistics.service';
import { DomainTypedManager } from './domain-typed-manager';
import { DomainCacheService } from './domain-cache.service';
+import { ClaimManagementService } from './claim-management.service';
@NgModule({
providers: [
@@ -12,7 +13,8 @@ import { DomainCacheService } from './domain-cache.service';
DomainTypedManager,
PaymentProcessingService,
MerchantStatisticsService,
- DomainCacheService
+ DomainCacheService,
+ ClaimManagementService
]
})
-export class ThriftModule {}
+export class DamselModule {}
diff --git a/src/app/thrift/domain-cache.service.ts b/src/app/thrift-services/damsel/domain-cache.service.ts
similarity index 87%
rename from src/app/thrift/domain-cache.service.ts
rename to src/app/thrift-services/damsel/domain-cache.service.ts
index 74d7884b..e45523ae 100644
--- a/src/app/thrift/domain-cache.service.ts
+++ b/src/app/thrift-services/damsel/domain-cache.service.ts
@@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { shareReplay, map } from 'rxjs/operators';
-import { Domain } from '../gen-damsel/domain';
import { DomainService } from './domain.service';
-import { toGenReference } from './converters';
+import { toGenReference } from '../converters';
+import { Domain } from './gen-model/domain';
@Injectable()
export class DomainCacheService {
diff --git a/src/app/thrift/domain-typed-manager.ts b/src/app/thrift-services/damsel/domain-typed-manager.ts
similarity index 96%
rename from src/app/thrift/domain-typed-manager.ts
rename to src/app/thrift-services/damsel/domain-typed-manager.ts
index 3eb487fc..62115d31 100644
--- a/src/app/thrift/domain-typed-manager.ts
+++ b/src/app/thrift-services/damsel/domain-typed-manager.ts
@@ -2,24 +2,24 @@ import { Injectable } from '@angular/core';
import { Observable, combineLatest } from 'rxjs';
import { map, switchMap, tap } from 'rxjs/operators';
-import {
- Domain,
- BusinessScheduleObject,
- ProviderObject,
- TerminalObject,
- PaymentInstitutionObject
-} from '../gen-damsel/domain';
import { findDomainObject, findDomainObjects } from './operations/utils';
import { getCreateTerminalCommit, CreateTerminalParams } from './operations';
-import { toGenReference } from './converters';
+import { toGenReference } from '../converters';
import { DomainService } from './domain.service';
import { addDecisionToProviderCommit, AddDecisionToProvider } from './operations';
import { DomainCacheService } from './domain-cache.service';
import { RemoveTerminalFromShopParams } from './operations/remove-terminal-from-shop-params';
import { createRemoveTerminalFromShopCommit } from './operations/create-remove-terminal-from-shop-commit';
-import { Version } from '../gen-damsel/domain_config';
import { editTerminalDecisionPropertyForShopCommit } from './operations/edit-terminal-decision-property-for-shop-commit';
import { EditTerminalDecisionPropertyParams } from './operations/edit-terminal-decision-property-params';
+import {
+ BusinessScheduleObject,
+ Domain,
+ PaymentInstitutionObject,
+ ProviderObject,
+ TerminalObject
+} from './gen-model/domain';
+import { Version } from './gen-model/domain_config';
const findBusinessScheduleObjects = (domain: Domain): BusinessScheduleObject[] =>
findDomainObjects(domain, 'business_schedule');
diff --git a/src/app/thrift/domain.service.ts b/src/app/thrift-services/damsel/domain.service.ts
similarity index 59%
rename from src/app/thrift/domain.service.ts
rename to src/app/thrift-services/damsel/domain.service.ts
index 46400076..c0c62c5e 100644
--- a/src/app/thrift/domain.service.ts
+++ b/src/app/thrift-services/damsel/domain.service.ts
@@ -1,15 +1,15 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
-import { KeycloakService } from 'keycloak-angular';
import * as Repository from './gen-nodejs/Repository';
-import { ThriftService } from './thrift-service';
-import { Reference, Snapshot, Commit, Version, Limit } from '../gen-damsel/domain_config';
+import { ThriftService } from '../thrift-service';
+import { Commit, Limit, Reference, Snapshot, Version } from './gen-model/domain_config';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class DomainService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/v1/domain/repository', Repository);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/domain/repository', Repository);
}
checkout: (reference: Reference) => Observable = this.toObservableAction('Checkout');
diff --git a/src/app/thrift/get-thrift-instance.ts b/src/app/thrift-services/damsel/get-thrift-instance.ts
similarity index 100%
rename from src/app/thrift/get-thrift-instance.ts
rename to src/app/thrift-services/damsel/get-thrift-instance.ts
diff --git a/src/app/thrift/merchant-statistics.service.ts b/src/app/thrift-services/damsel/merchant-statistics.service.ts
similarity index 56%
rename from src/app/thrift/merchant-statistics.service.ts
rename to src/app/thrift-services/damsel/merchant-statistics.service.ts
index e55e234c..caf25fed 100644
--- a/src/app/thrift/merchant-statistics.service.ts
+++ b/src/app/thrift-services/damsel/merchant-statistics.service.ts
@@ -1,16 +1,16 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
-import { KeycloakService } from 'keycloak-angular';
import * as MerchantStatistics from './gen-nodejs/MerchantStatistics';
-import { ThriftService } from './thrift-service';
-import { StatRequest, StatResponse } from '../gen-damsel/merch_stat';
+import { ThriftService } from '../thrift-service';
import { StatRequest as ThriftStatRequest } from './gen-nodejs/merch_stat_types';
+import { StatRequest, StatResponse } from './gen-model/merch_stat';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class MerchantStatisticsService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/stat', MerchantStatistics);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/stat', MerchantStatistics);
}
getPayments = (req: StatRequest): Observable =>
diff --git a/src/app/thrift/operations/add-decision-to-provider-commit.ts b/src/app/thrift-services/damsel/operations/add-decision-to-provider-commit.ts
similarity index 77%
rename from src/app/thrift/operations/add-decision-to-provider-commit.ts
rename to src/app/thrift-services/damsel/operations/add-decision-to-provider-commit.ts
index 34f7be4a..1f0d8f7d 100644
--- a/src/app/thrift/operations/add-decision-to-provider-commit.ts
+++ b/src/app/thrift-services/damsel/operations/add-decision-to-provider-commit.ts
@@ -1,7 +1,7 @@
-import { ProviderObject } from '../../gen-damsel/domain';
-import { Commit } from '../../gen-damsel/domain_config';
-import { toGenCommit } from '../converters';
+import { toGenCommit } from '../../converters';
import { createAddTerminalToProviderOperation } from './create-add-terminal-to-provider-operation';
+import { ProviderObject } from '../gen-model/domain';
+import { Commit } from '../gen-model/domain_config';
export class AddDecisionToProvider {
partyID: string;
diff --git a/src/app/thrift/operations/add-terminal-decision.ts b/src/app/thrift-services/damsel/operations/add-terminal-decision.ts
similarity index 94%
rename from src/app/thrift/operations/add-terminal-decision.ts
rename to src/app/thrift-services/damsel/operations/add-terminal-decision.ts
index 715b841a..f7e9e456 100644
--- a/src/app/thrift/operations/add-terminal-decision.ts
+++ b/src/app/thrift-services/damsel/operations/add-terminal-decision.ts
@@ -2,9 +2,9 @@ import cloneDeep from 'lodash-es/cloneDeep';
import last from 'lodash-es/last';
import dropRight from 'lodash-es/dropRight';
-import { ProviderObject, TerminalDecision, TerminalRef } from '../../gen-damsel/domain';
-import { toGenTerminalDecision } from '../converters';
+import { toGenTerminalDecision } from '../../converters';
import { checkSelector } from './utils';
+import { ProviderObject, TerminalDecision, TerminalRef } from '../gen-model/domain';
const createDecision = (partyID: string, shopID: string, terminalID: number): TerminalDecision => ({
if_: {
diff --git a/src/app/thrift/operations/create-add-terminal-to-provider-operation.ts b/src/app/thrift-services/damsel/operations/create-add-terminal-to-provider-operation.ts
similarity index 74%
rename from src/app/thrift/operations/create-add-terminal-to-provider-operation.ts
rename to src/app/thrift-services/damsel/operations/create-add-terminal-to-provider-operation.ts
index 141f578a..5c3e9349 100644
--- a/src/app/thrift/operations/create-add-terminal-to-provider-operation.ts
+++ b/src/app/thrift-services/damsel/operations/create-add-terminal-to-provider-operation.ts
@@ -1,8 +1,8 @@
-import { toGenDomainObject } from '../converters';
+import { toGenDomainObject } from '../../converters';
import { addTerminalDecision } from './add-terminal-decision';
-import { ProviderObject } from '../../gen-damsel/domain';
import { AddDecisionToProvider } from './add-decision-to-provider-commit';
-import { UpdateOp } from '../../gen-damsel/domain_config';
+import { ProviderObject } from '../gen-model/domain';
+import { UpdateOp } from '../gen-model/domain_config';
export const createAddTerminalToProviderOperation = (
providerObject: ProviderObject,
diff --git a/src/app/thrift/operations/create-remove-terminal-from-provider-operation.ts b/src/app/thrift-services/damsel/operations/create-remove-terminal-from-provider-operation.ts
similarity index 76%
rename from src/app/thrift/operations/create-remove-terminal-from-provider-operation.ts
rename to src/app/thrift-services/damsel/operations/create-remove-terminal-from-provider-operation.ts
index 81f73eb9..83543ed0 100644
--- a/src/app/thrift/operations/create-remove-terminal-from-provider-operation.ts
+++ b/src/app/thrift-services/damsel/operations/create-remove-terminal-from-provider-operation.ts
@@ -1,8 +1,8 @@
-import { ProviderObject } from '../../gen-damsel/domain';
-import { UpdateOp } from '../../gen-damsel/domain_config';
-import { toGenDomainObject } from '../converters';
+import { toGenDomainObject } from '../../converters';
import { RemoveTerminalFromShopParams } from './remove-terminal-from-shop-params';
import { removeTerminalDecision } from './remove-terminal-decision';
+import { ProviderObject } from '../gen-model/domain';
+import { UpdateOp } from '../gen-model/domain_config';
export const createRemoveTerminalFromProviderOperation = (
providerObject: ProviderObject,
diff --git a/src/app/thrift/operations/create-remove-terminal-from-shop-commit.ts b/src/app/thrift-services/damsel/operations/create-remove-terminal-from-shop-commit.ts
similarity index 77%
rename from src/app/thrift/operations/create-remove-terminal-from-shop-commit.ts
rename to src/app/thrift-services/damsel/operations/create-remove-terminal-from-shop-commit.ts
index 818fd033..60abeccf 100644
--- a/src/app/thrift/operations/create-remove-terminal-from-shop-commit.ts
+++ b/src/app/thrift-services/damsel/operations/create-remove-terminal-from-shop-commit.ts
@@ -1,8 +1,8 @@
import { RemoveTerminalFromShopParams } from './remove-terminal-from-shop-params';
-import { toGenCommit } from '../converters';
+import { toGenCommit } from '../../converters';
import { createRemoveTerminalFromProviderOperation } from './create-remove-terminal-from-provider-operation';
-import { ProviderObject } from '../../gen-damsel/domain';
-import { Commit } from '../../gen-damsel/domain_config';
+import { ProviderObject } from '../gen-model/domain';
+import { Commit } from '../gen-model/domain_config';
export const createRemoveTerminalFromShopCommit = (
providerObject: ProviderObject,
diff --git a/src/app/thrift/operations/create-terminal-object.ts b/src/app/thrift-services/damsel/operations/create-terminal-object.ts
similarity index 87%
rename from src/app/thrift/operations/create-terminal-object.ts
rename to src/app/thrift-services/damsel/operations/create-terminal-object.ts
index 251fe8e9..46eb7bd7 100644
--- a/src/app/thrift/operations/create-terminal-object.ts
+++ b/src/app/thrift-services/damsel/operations/create-terminal-object.ts
@@ -1,7 +1,7 @@
import { CreateTerminalParams } from './create-terminal-params';
import { generateID, toMap } from './utils';
-import { TerminalObject } from '../../gen-damsel/domain';
-import { toGenTerminalObject } from '../converters';
+import { toGenTerminalObject } from '../../converters';
+import { TerminalObject } from '../gen-model/domain';
const convert = (id: number, params: CreateTerminalParams): TerminalObject => ({
ref: {
diff --git a/src/app/thrift/operations/create-terminal-params.ts b/src/app/thrift-services/damsel/operations/create-terminal-params.ts
similarity index 81%
rename from src/app/thrift/operations/create-terminal-params.ts
rename to src/app/thrift-services/damsel/operations/create-terminal-params.ts
index 6f8881cb..d7fc2079 100644
--- a/src/app/thrift/operations/create-terminal-params.ts
+++ b/src/app/thrift-services/damsel/operations/create-terminal-params.ts
@@ -1,4 +1,4 @@
-import { RiskScore } from '../../gen-damsel/domain';
+import { RiskScore } from '../gen-model/domain';
export class TerminalOption {
key: string;
diff --git a/src/app/thrift/operations/edit-terminal-decision-operations.ts b/src/app/thrift-services/damsel/operations/edit-terminal-decision-operations.ts
similarity index 76%
rename from src/app/thrift/operations/edit-terminal-decision-operations.ts
rename to src/app/thrift-services/damsel/operations/edit-terminal-decision-operations.ts
index ff212038..7ca1fb7f 100644
--- a/src/app/thrift/operations/edit-terminal-decision-operations.ts
+++ b/src/app/thrift-services/damsel/operations/edit-terminal-decision-operations.ts
@@ -1,8 +1,8 @@
-import { ProviderObject } from '../../gen-damsel/domain';
-import { UpdateOp } from '../../gen-damsel/domain_config';
-import { toGenDomainObject } from '../converters';
+import { toGenDomainObject } from '../../converters';
import { editTerminalDecisionPropertyForShop } from './edit-terminal-decision-property-for-shop';
import { EditTerminalDecisionPropertyParams } from './edit-terminal-decision-property-params';
+import { ProviderObject } from '../gen-model/domain';
+import { UpdateOp } from '../gen-model/domain_config';
export const editTerminalDecisionPropertyForShopOperation = (
providerObject: ProviderObject,
diff --git a/src/app/thrift/operations/edit-terminal-decision-property-for-shop-commit.ts b/src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop-commit.ts
similarity index 77%
rename from src/app/thrift/operations/edit-terminal-decision-property-for-shop-commit.ts
rename to src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop-commit.ts
index ed1c41dc..d34e5209 100644
--- a/src/app/thrift/operations/edit-terminal-decision-property-for-shop-commit.ts
+++ b/src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop-commit.ts
@@ -1,8 +1,8 @@
-import { ProviderObject } from '../../gen-damsel/domain';
-import { Commit } from '../../gen-damsel/domain_config';
-import { toGenCommit } from '../converters';
+import { toGenCommit } from '../../converters';
import { editTerminalDecisionPropertyForShopOperation } from './edit-terminal-decision-operations';
import { EditTerminalDecisionPropertyParams } from './edit-terminal-decision-property-params';
+import { ProviderObject } from '../gen-model/domain';
+import { Commit } from '../gen-model/domain_config';
export const editTerminalDecisionPropertyForShopCommit = (
providerObject: ProviderObject,
diff --git a/src/app/thrift/operations/edit-terminal-decision-property-for-shop.ts b/src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop.ts
similarity index 95%
rename from src/app/thrift/operations/edit-terminal-decision-property-for-shop.ts
rename to src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop.ts
index db8038e4..93650498 100644
--- a/src/app/thrift/operations/edit-terminal-decision-property-for-shop.ts
+++ b/src/app/thrift-services/damsel/operations/edit-terminal-decision-property-for-shop.ts
@@ -1,9 +1,9 @@
import cloneDeep from 'lodash-es/cloneDeep';
import get from 'lodash-es/get';
-import { ProviderObject, TerminalDecision } from '../../gen-damsel/domain';
import { EditTerminalDecisionPropertyParams } from './edit-terminal-decision-property-params';
import { checkSelector } from './utils';
+import { ProviderObject, TerminalDecision } from '../gen-model/domain';
const editDecision = (
decisions: TerminalDecision[],
diff --git a/src/app/thrift/operations/edit-terminal-decision-property-params.ts b/src/app/thrift-services/damsel/operations/edit-terminal-decision-property-params.ts
similarity index 100%
rename from src/app/thrift/operations/edit-terminal-decision-property-params.ts
rename to src/app/thrift-services/damsel/operations/edit-terminal-decision-property-params.ts
diff --git a/src/app/thrift/operations/get-create-terminal-commit.ts b/src/app/thrift-services/damsel/operations/get-create-terminal-commit.ts
similarity index 80%
rename from src/app/thrift/operations/get-create-terminal-commit.ts
rename to src/app/thrift-services/damsel/operations/get-create-terminal-commit.ts
index f665ff0c..c7598236 100644
--- a/src/app/thrift/operations/get-create-terminal-commit.ts
+++ b/src/app/thrift-services/damsel/operations/get-create-terminal-commit.ts
@@ -1,8 +1,8 @@
import { createTerminalObject } from './create-terminal-object';
import { CreateTerminalParams } from './create-terminal-params';
-import { toGenCommit, toGenDomainObject } from '../converters';
-import { TerminalObject } from '../../gen-damsel/domain';
-import { Commit } from '../../gen-damsel/domain_config';
+import { toGenCommit, toGenDomainObject } from '../../converters';
+import { TerminalObject } from '../gen-model/domain';
+import { Commit } from '../gen-model/domain_config';
export interface GetCreateTerminalCommit {
commit: Commit;
diff --git a/src/app/thrift/operations/index.ts b/src/app/thrift-services/damsel/operations/index.ts
similarity index 100%
rename from src/app/thrift/operations/index.ts
rename to src/app/thrift-services/damsel/operations/index.ts
diff --git a/src/app/thrift/operations/remove-terminal-decision.ts b/src/app/thrift-services/damsel/operations/remove-terminal-decision.ts
similarity index 96%
rename from src/app/thrift/operations/remove-terminal-decision.ts
rename to src/app/thrift-services/damsel/operations/remove-terminal-decision.ts
index 84597050..4a15b0b2 100644
--- a/src/app/thrift/operations/remove-terminal-decision.ts
+++ b/src/app/thrift-services/damsel/operations/remove-terminal-decision.ts
@@ -1,7 +1,7 @@
import cloneDeep from 'lodash-es/cloneDeep';
-import { ProviderObject, TerminalDecision } from '../../gen-damsel/domain';
import { checkSelector } from './utils';
+import { ProviderObject, TerminalDecision } from '../gen-model/domain';
const checkCondition = (condition: any, partyID: string, shopID: string): boolean => {
const isPartyEquals = condition.party.id === partyID;
diff --git a/src/app/thrift/operations/remove-terminal-from-shop-params.ts b/src/app/thrift-services/damsel/operations/remove-terminal-from-shop-params.ts
similarity index 100%
rename from src/app/thrift/operations/remove-terminal-from-shop-params.ts
rename to src/app/thrift-services/damsel/operations/remove-terminal-from-shop-params.ts
diff --git a/src/app/thrift/operations/utils.ts b/src/app/thrift-services/damsel/operations/utils.ts
similarity index 95%
rename from src/app/thrift/operations/utils.ts
rename to src/app/thrift-services/damsel/operations/utils.ts
index c753ed65..80bc1a19 100644
--- a/src/app/thrift/operations/utils.ts
+++ b/src/app/thrift-services/damsel/operations/utils.ts
@@ -1,7 +1,6 @@
import sortBy from 'lodash-es/sortBy';
import transform from 'lodash-es/transform';
-
-import { Domain, TerminalSelector } from '../../gen-damsel/domain';
+import { Domain, TerminalSelector } from '../gen-model/domain';
export const generateID = (domainObjects: any[]): number => {
const objWithMaxId = sortBy(domainObjects, obj => obj.ref.id)[domainObjects.length - 1];
diff --git a/src/app/thrift/payment-processing.service.ts b/src/app/thrift-services/damsel/payment-processing.service.ts
similarity index 86%
rename from src/app/thrift/payment-processing.service.ts
rename to src/app/thrift-services/damsel/payment-processing.service.ts
index 1196ce8e..ccf03959 100644
--- a/src/app/thrift/payment-processing.service.ts
+++ b/src/app/thrift-services/damsel/payment-processing.service.ts
@@ -1,27 +1,27 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable, timer } from 'rxjs';
import { share, switchMap, first } from 'rxjs/operators';
-import { KeycloakService } from 'keycloak-angular';
import {
InvoicePaymentAdjustmentParams as InvoicePaymentAdjustmentParamsObject,
UserInfo as UserInfoObject,
InvoiceRepairScenario as InvoiceRepairScenarioObject
} from './gen-nodejs/payment_processing_types';
+import { ThriftService } from '../thrift-service';
+import * as Invoicing from './gen-nodejs/Invoicing';
+import { InvoiceID } from './gen-model/domain';
import {
InvoicePaymentAdjustment,
InvoicePaymentAdjustmentParams,
- UserInfo,
- InvoiceRepairScenario
-} from '../gen-damsel/payment_processing';
-import { ThriftService } from './thrift-service';
-import * as Invoicing from './gen-nodejs/Invoicing';
-import { InvoiceID } from '../gen-damsel/domain';
+ InvoiceRepairScenario,
+ UserInfo
+} from './gen-model/payment_processing';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class PaymentProcessingService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/v1/processing/invoicing', Invoicing);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/processing/invoicing', Invoicing);
}
getPaymentAdjustment = (
diff --git a/src/app/thrift-services/file-storage/file-storage.module.ts b/src/app/thrift-services/file-storage/file-storage.module.ts
new file mode 100644
index 00000000..2c5ed32a
--- /dev/null
+++ b/src/app/thrift-services/file-storage/file-storage.module.ts
@@ -0,0 +1,4 @@
+import { NgModule } from '@angular/core';
+
+@NgModule({})
+export class FileStorageModule {}
diff --git a/src/app/thrift-services/file-storage/file-storage.service.ts b/src/app/thrift-services/file-storage/file-storage.service.ts
new file mode 100644
index 00000000..be0dfd4a
--- /dev/null
+++ b/src/app/thrift-services/file-storage/file-storage.service.ts
@@ -0,0 +1,34 @@
+import { Injectable, NgZone } from '@angular/core';
+import { Observable } from 'rxjs';
+
+import { ThriftService } from '../thrift-service';
+import * as FileStorage from './gen-nodejs/FileStorage';
+import {
+ FileData,
+ FileDataID,
+ FileNotFound,
+ Metadata,
+ NewFileResult,
+ URL
+} from './gen-model/file_storage';
+import { Timestamp } from './gen-model/base';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
+
+@Injectable()
+export class FileStorageService extends ThriftService {
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/file_storage', FileStorage);
+ }
+
+ createNewFile = (metadata: Metadata, expires_at: Timestamp): Observable =>
+ this.toObservableAction('CreateNewFile')(metadata, expires_at);
+
+ generateDownloadUrl = (
+ file_data_id: FileDataID,
+ expires_at: Timestamp
+ ): Observable =>
+ this.toObservableAction('GenerateDownloadUrl')(file_data_id, expires_at);
+
+ getFileData = (file_data_id: FileDataID): Observable =>
+ this.toObservableAction('GetFileData')(file_data_id);
+}
diff --git a/src/app/thrift-services/file-storage/index.ts b/src/app/thrift-services/file-storage/index.ts
new file mode 100644
index 00000000..f51ebedd
--- /dev/null
+++ b/src/app/thrift-services/file-storage/index.ts
@@ -0,0 +1 @@
+export * from './file-storage.module';
diff --git a/src/app/thrift/filters/filter-providers-by-categories.ts b/src/app/thrift-services/filters/filter-providers-by-categories.ts
similarity index 86%
rename from src/app/thrift/filters/filter-providers-by-categories.ts
rename to src/app/thrift-services/filters/filter-providers-by-categories.ts
index 6afbaa88..3d928716 100644
--- a/src/app/thrift/filters/filter-providers-by-categories.ts
+++ b/src/app/thrift-services/filters/filter-providers-by-categories.ts
@@ -1,7 +1,5 @@
import get from 'lodash-es/get';
-
-import { ProviderObject } from '../../gen-damsel/domain';
-import { CategoryRef } from '../../gen-damsel/domain';
+import { CategoryRef, ProviderObject } from '../damsel/gen-model/domain';
export const filterProvidersByCategories = (
objects: ProviderObject[],
diff --git a/src/app/thrift/filters/filter-providers-by-category-id.ts b/src/app/thrift-services/filters/filter-providers-by-category-id.ts
similarity index 88%
rename from src/app/thrift/filters/filter-providers-by-category-id.ts
rename to src/app/thrift-services/filters/filter-providers-by-category-id.ts
index f3177a8d..08dd3c64 100644
--- a/src/app/thrift/filters/filter-providers-by-category-id.ts
+++ b/src/app/thrift-services/filters/filter-providers-by-category-id.ts
@@ -1,5 +1,5 @@
-import { ProviderObject } from '../../gen-damsel/domain';
import get from 'lodash-es/get';
+import { ProviderObject } from '../damsel/gen-model/domain';
export const filterProvidersByCategoryId = (
objects: ProviderObject[],
diff --git a/src/app/thrift/filters/filter-providers-by-terminal-selector.ts b/src/app/thrift-services/filters/filter-providers-by-terminal-selector.ts
similarity index 87%
rename from src/app/thrift/filters/filter-providers-by-terminal-selector.ts
rename to src/app/thrift-services/filters/filter-providers-by-terminal-selector.ts
index 4ab85503..6e606a1f 100644
--- a/src/app/thrift/filters/filter-providers-by-terminal-selector.ts
+++ b/src/app/thrift-services/filters/filter-providers-by-terminal-selector.ts
@@ -1,4 +1,4 @@
-import { ProviderObject } from '../../gen-damsel/domain';
+import { ProviderObject } from '../damsel/gen-model/domain';
export const filterProvidersByTerminalSelector = (
objects: ProviderObject[],
diff --git a/src/app/thrift/filters/index.ts b/src/app/thrift-services/filters/index.ts
similarity index 100%
rename from src/app/thrift/filters/index.ts
rename to src/app/thrift-services/filters/index.ts
diff --git a/src/app/fistful/fistful-admin.service.ts b/src/app/thrift-services/fistful/fistful-admin.service.ts
similarity index 65%
rename from src/app/fistful/fistful-admin.service.ts
rename to src/app/thrift-services/fistful/fistful-admin.service.ts
index 7daf06cc..f75fbf83 100644
--- a/src/app/fistful/fistful-admin.service.ts
+++ b/src/app/thrift-services/fistful/fistful-admin.service.ts
@@ -1,16 +1,16 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
-import { KeycloakService } from 'keycloak-angular';
import { DepositParams } from './gen-model/fistful_admin';
import { DepositParams as DepositParamsObject } from './gen-nodejs/fistful_admin_types';
-import { ThriftService } from '../thrift';
+import { ThriftService } from '../thrift-service';
import * as FistfulAdmin from './gen-nodejs/FistfulAdmin';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class FistfulAdminService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/v1/admin', FistfulAdmin);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/admin', FistfulAdmin);
}
createDeposit(params: DepositParams): Observable {
diff --git a/src/app/fistful/fistful-stat.service.ts b/src/app/thrift-services/fistful/fistful-stat.service.ts
similarity index 84%
rename from src/app/fistful/fistful-stat.service.ts
rename to src/app/thrift-services/fistful/fistful-stat.service.ts
index a8d3e144..84acd44c 100644
--- a/src/app/fistful/fistful-stat.service.ts
+++ b/src/app/thrift-services/fistful/fistful-stat.service.ts
@@ -2,21 +2,21 @@ import { Injectable, NgZone } from '@angular/core';
import { FetchResult } from '@rbkmoney/partial-fetcher';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
-import { KeycloakService } from 'keycloak-angular';
-import { ThriftService } from '../thrift';
+import { ThriftService } from '../thrift-service';
import * as FistfulStatistics from './gen-nodejs/FistfulStatistics';
import { StatRequest as ThriftStatRequest } from './gen-nodejs/fistful_stat_types';
import { StatDeposit, StatRequest } from './gen-model/fistful_stat';
-import { SearchFormParams } from '../deposits/search-form/search-form-params';
-import { QueryDSL } from '../query-dsl';
+import { SearchFormParams } from '../../deposits/search-form/search-form-params';
+import { QueryDSL } from '../../query-dsl';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class FistfulStatisticsService extends ThriftService {
private readonly searchLimit = 20;
- constructor(keycloakService: KeycloakService, zone: NgZone) {
- super(zone, keycloakService, '/fistful/stat', FistfulStatistics);
+ constructor(keycloakTokenInfoService: KeycloakTokenInfoService, zone: NgZone) {
+ super(zone, keycloakTokenInfoService, '/fistful/stat', FistfulStatistics);
}
getDeposits(
diff --git a/src/app/fistful/fistful.module.ts b/src/app/thrift-services/fistful/fistful.module.ts
similarity index 100%
rename from src/app/fistful/fistful.module.ts
rename to src/app/thrift-services/fistful/fistful.module.ts
diff --git a/src/app/fistful/repairer.service.ts b/src/app/thrift-services/fistful/repairer.service.ts
similarity index 64%
rename from src/app/fistful/repairer.service.ts
rename to src/app/thrift-services/fistful/repairer.service.ts
index c850b4fe..cb2b3516 100644
--- a/src/app/fistful/repairer.service.ts
+++ b/src/app/thrift-services/fistful/repairer.service.ts
@@ -1,16 +1,16 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
-import { KeycloakService } from 'keycloak-angular';
-import { ThriftService } from '../thrift';
+import { ThriftService } from '../thrift-service';
import { RepairScenario, SessionID } from './gen-model/withdrawal_session';
import { RepairScenario as RepairScenarioObject } from './gen-nodejs/withdrawal_session_types';
import * as Repairer from './gen-nodejs/Repairer';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class RepairerService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/v1/repair/withdrawal/session', Repairer);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/repair/withdrawal/session', Repairer);
}
repair = (id: SessionID, scenario: RepairScenario): Observable =>
diff --git a/src/app/thrift-services/index.ts b/src/app/thrift-services/index.ts
new file mode 100644
index 00000000..143124dd
--- /dev/null
+++ b/src/app/thrift-services/index.ts
@@ -0,0 +1,9 @@
+export * from './damsel/domain-typed-manager';
+export * from './damsel/domain.service';
+export * from './thrift-service';
+export * from './damsel/operations';
+export * from './filters';
+export * from './damsel/get-thrift-instance';
+export * from './ank';
+export * from './file-storage';
+export * from './messages';
diff --git a/src/app/machinegun/automaton.service.ts b/src/app/thrift-services/machinegun/automaton.service.ts
similarity index 73%
rename from src/app/machinegun/automaton.service.ts
rename to src/app/thrift-services/machinegun/automaton.service.ts
index 6ed76ee4..df11caae 100644
--- a/src/app/machinegun/automaton.service.ts
+++ b/src/app/thrift-services/machinegun/automaton.service.ts
@@ -1,20 +1,20 @@
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
-import { KeycloakService } from 'keycloak-angular';
import * as Automaton from './gen-nodejs/Automaton';
import {
Reference as ReferenceObject,
MachineDescriptor as MachineDescriptorObject
} from './gen-nodejs/state_processing_types';
-import { ThriftService } from '../thrift';
+import { ThriftService } from '../thrift-service';
import { Namespace } from './gen-model/base';
import { Reference, MachineDescriptor, Machine } from './gen-model/state_processing';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
@Injectable()
export class AutomatonService extends ThriftService {
- constructor(zone: NgZone, keycloakService: KeycloakService) {
- super(zone, keycloakService, '/v1/automaton', Automaton);
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/automaton', Automaton);
}
simpleRepair = (ns: Namespace, ref: Reference): Observable =>
diff --git a/src/app/machinegun/machinegun.module.ts b/src/app/thrift-services/machinegun/machinegun.module.ts
similarity index 100%
rename from src/app/machinegun/machinegun.module.ts
rename to src/app/thrift-services/machinegun/machinegun.module.ts
diff --git a/src/app/machinegun/model/namespace.ts b/src/app/thrift-services/machinegun/model/namespace.ts
similarity index 100%
rename from src/app/machinegun/model/namespace.ts
rename to src/app/thrift-services/machinegun/model/namespace.ts
diff --git a/src/app/thrift-services/messages/index.ts b/src/app/thrift-services/messages/index.ts
new file mode 100644
index 00000000..76243f37
--- /dev/null
+++ b/src/app/thrift-services/messages/index.ts
@@ -0,0 +1 @@
+export * from './messages.module';
diff --git a/src/app/thrift-services/messages/messages.module.ts b/src/app/thrift-services/messages/messages.module.ts
new file mode 100644
index 00000000..3f05170e
--- /dev/null
+++ b/src/app/thrift-services/messages/messages.module.ts
@@ -0,0 +1,7 @@
+import { NgModule } from '@angular/core';
+import { MessagesService } from './messages.service';
+
+@NgModule({
+ providers: [MessagesService]
+})
+export class MessagesModule {}
diff --git a/src/app/thrift-services/messages/messages.service.ts b/src/app/thrift-services/messages/messages.service.ts
new file mode 100644
index 00000000..8b622037
--- /dev/null
+++ b/src/app/thrift-services/messages/messages.service.ts
@@ -0,0 +1,37 @@
+import { Injectable, NgZone } from '@angular/core';
+import { Observable } from 'rxjs';
+
+import { ThriftService } from '../thrift-service';
+import * as MessageServiceClient from './gen-nodejs/MessageService';
+import {
+ ConversationFilter as ConversationFilterType,
+ User as UserType,
+ Conversation as ConversationType
+} from './gen-nodejs/messages_types';
+import {
+ Conversation,
+ ConversationFilter,
+ ConversationId,
+ GetConversationResponse,
+ User
+} from './gen-model/messages';
+import { KeycloakTokenInfoService } from '../../keycloak-token-info.service';
+
+@Injectable()
+export class MessagesService extends ThriftService {
+ constructor(zone: NgZone, keycloakTokenInfoService: KeycloakTokenInfoService) {
+ super(zone, keycloakTokenInfoService, '/v1/messages', MessageServiceClient);
+ }
+
+ getConversations = (
+ ids: ConversationId[],
+ filter: ConversationFilter
+ ): Observable =>
+ this.toObservableAction('GetConversations')(ids, new ConversationFilterType(filter));
+
+ saveConversations = (conversations: Conversation[], user: User): Observable =>
+ this.toObservableAction('SaveConversations')(
+ conversations.map(c => new ConversationType(c)),
+ new UserType(user)
+ );
+}
diff --git a/src/app/thrift-services/messages/utils/create-single-message-conversation-params.ts b/src/app/thrift-services/messages/utils/create-single-message-conversation-params.ts
new file mode 100644
index 00000000..233ae12f
--- /dev/null
+++ b/src/app/thrift-services/messages/utils/create-single-message-conversation-params.ts
@@ -0,0 +1,14 @@
+import * as uuid from 'uuid/v4';
+import * as moment from 'moment';
+
+import { Conversation, ConversationStatus } from '../gen-model/messages';
+
+export const createSingleMessageConversationParams = (
+ conversation_id: string,
+ text: string,
+ user_id: string
+): Conversation => ({
+ conversation_id,
+ messages: [{ message_id: uuid(), text, user_id, timestamp: moment().toISOString() }],
+ status: ConversationStatus.ACTUAL
+});
diff --git a/src/app/thrift-services/messages/utils/index.ts b/src/app/thrift-services/messages/utils/index.ts
new file mode 100644
index 00000000..1ffbf96b
--- /dev/null
+++ b/src/app/thrift-services/messages/utils/index.ts
@@ -0,0 +1 @@
+export * from './create-single-message-conversation-params';
diff --git a/src/app/thrift-services/thrift-service.ts b/src/app/thrift-services/thrift-service.ts
new file mode 100644
index 00000000..c2838d10
--- /dev/null
+++ b/src/app/thrift-services/thrift-service.ts
@@ -0,0 +1,71 @@
+import { NgZone } from '@angular/core';
+import { Observable } from 'rxjs';
+import { timeout } from 'rxjs/operators';
+import connectClient from 'woody_js';
+
+import { KeycloakTokenInfoService } from '../keycloak-token-info.service';
+
+type Exception = {
+ name: N;
+ message: string;
+} & T;
+
+export class ThriftService {
+ protected endpoint: string;
+ protected service: any;
+ protected realm = 'internal';
+
+ constructor(
+ private zone: NgZone,
+ private keycloakTokenInfoService: KeycloakTokenInfoService,
+ endpoint: string,
+ thriftService: any
+ ) {
+ this.endpoint = endpoint;
+ this.service = thriftService;
+ }
+
+ protected toObservableAction Observable>(name: string): T {
+ return ((...args) =>
+ Observable.create(observer => {
+ const cb = msg => {
+ observer.error(msg);
+ observer.complete();
+ };
+ this.zone.run(() => {
+ try {
+ const client = this.createClient(cb);
+ client[name](...args, (ex: Exception, result) => {
+ ex ? observer.error(ex) : observer.next(result);
+ observer.complete();
+ });
+ } catch (e) {
+ cb(e);
+ }
+ });
+ }).pipe(timeout(60000))) as any;
+ }
+
+ private createClient(errorCb: Function) {
+ const { email, preferred_username, sub } = this.keycloakTokenInfoService.decodedUserToken;
+ return connectClient(
+ location.hostname,
+ location.port,
+ this.endpoint,
+ this.service,
+ {
+ headers: {
+ 'woody.meta-user-identity.email': email,
+ 'woody.meta-user-identity.realm': this.realm,
+ 'woody.meta-user-identity.username': preferred_username,
+ 'woody.meta-user-identity.id': sub,
+ 'x-rbk-meta-user-identity.email': email,
+ 'x-rbk-meta-user-identity.realm': this.realm,
+ 'x-rbk-meta-user-identity.username': preferred_username,
+ 'x-rbk-meta-user-identity.id': sub
+ }
+ },
+ errorCb
+ );
+ }
+}
diff --git a/src/app/thrift/index.ts b/src/app/thrift/index.ts
deleted file mode 100644
index c7fbe9e8..00000000
--- a/src/app/thrift/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export * from './domain-typed-manager';
-export * from './domain.service';
-export * from './thrift-service';
-export * from './operations';
-export * from './filters';
-export * from './get-thrift-instance';
diff --git a/src/app/thrift/thrift-service.ts b/src/app/thrift/thrift-service.ts
deleted file mode 100644
index 1601003e..00000000
--- a/src/app/thrift/thrift-service.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import { NgZone } from '@angular/core';
-import { Observable, from } from 'rxjs';
-import { map, timeout } from 'rxjs/operators';
-import connectClient from 'woody_js';
-import { KeycloakService } from 'keycloak-angular';
-import * as jwtDecode from 'jwt-decode';
-
-type Exception = {
- name: N;
- message: string;
-} & T;
-
-export class ThriftService {
- protected endpoint: string;
- protected service: any;
- protected realm = 'internal';
-
- constructor(
- private zone: NgZone,
- private keycloakService: KeycloakService,
- endpoint: string,
- thriftService: any
- ) {
- this.endpoint = endpoint;
- this.service = thriftService;
- }
-
- protected toObservableAction Observable>(name: string): T {
- return ((...args) =>
- Observable.create(observer => {
- const cb = msg => {
- observer.error(msg);
- observer.complete();
- };
- this.zone.run(() => {
- try {
- this.createClient(cb).subscribe(client =>
- client[name](...args, (ex: Exception, result) => {
- ex ? observer.error(ex) : observer.next(result);
- observer.complete();
- })
- );
- } catch (e) {
- cb(e);
- }
- });
- }).pipe(timeout(60000))) as any;
- }
-
- private createClient(errorCb: Function) {
- return from(this.keycloakService.getToken()).pipe(
- map(token => {
- const { email, preferred_username, sub } = jwtDecode(token);
- return connectClient(
- location.hostname,
- location.port,
- this.endpoint,
- this.service,
- {
- headers: {
- 'woody.meta-user-identity.email': email,
- 'woody.meta-user-identity.realm': this.realm,
- 'woody.meta-user-identity.username': preferred_username,
- 'woody.meta-user-identity.id': sub,
- 'x-rbk-meta-user-identity.email': email,
- 'x-rbk-meta-user-identity.realm': this.realm,
- 'x-rbk-meta-user-identity.username': preferred_username,
- 'x-rbk-meta-user-identity.id': sub
- }
- },
- errorCb
- );
- })
- );
- }
-}
diff --git a/tsconfig.json b/tsconfig.json
index 271de998..a7241345 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,7 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
- "module": "es2015",
+ "module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,