claims case fix (#68)

* claims case fix

* duplicate was removed

* generated files added to prettier ignore list
This commit is contained in:
Denis Ezhov 2019-03-18 17:20:30 +03:00 committed by GitHub
parent 98b8fdd5ab
commit 923288d432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 23 deletions

View File

@ -4,3 +4,4 @@ node_modules
dist
build_utils
.scannerwork
gen-*

View File

@ -1,7 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef, MatSnackBar } from '@angular/material';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { ActionType, ModificationAction } from '../modification-action';
import { ModificationGroupType } from '../model';

View File

@ -1,10 +1,10 @@
export enum ContractModificationName {
creation = 'creation',
termination = 'termination',
adjustmentModification = 'adjustmentModification',
payoutToolModification = 'payoutToolModification',
legalAgreementBinding = 'legalAgreementBinding',
reportPreferencesModification = 'reportPreferencesModification',
contractorModification = 'contractorModification',
adjustmentModification = 'adjustment_modification',
payoutToolModification = 'payout_tool_modification',
legalAgreementBinding = 'legal_agreement_binding',
reportPreferencesModification = 'report_preferences_modification',
contractorModification = 'contractor_modification',
unknown = 'unknown'
}

View File

@ -1,11 +1,11 @@
export enum ShopModificationName {
creation = 'creation',
categoryModification = 'categoryModification',
detailsModification = 'detailsModification',
contractModification = 'contractModification',
payoutToolModification = 'payoutToolModification',
locationModification = 'locationModification',
shopAccountCreation = 'shopAccountCreation',
payoutScheduleModification = 'payoutScheduleModification',
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'
}

View File

@ -7,6 +7,7 @@ import {
PersistentContainer
} from './model';
import { ContractModificationUnit, ShopModificationUnit } from '../gen-damsel/payment_processing';
import { UnitName } from '../party-modification-creation/unit-name';
interface PersistentUnit {
modificationUnit: ShopModificationUnit | ContractModificationUnit;
@ -14,11 +15,6 @@ interface PersistentUnit {
typeHash: string;
}
enum GroupName {
shopModification = 'shopModification',
contractModification = 'contractModification'
}
const toContainers = (persistentUnits: PersistentUnit[]): any[] => {
const grouped = groupBy(persistentUnits, item => {
const modificationNames = Object.keys(item.modificationUnit.modification);
@ -50,7 +46,7 @@ const toUnits = (persistentUnits: PersistentUnit[]): PartyModificationUnit[] =>
};
const toGroup = (
name: GroupName,
name: UnitName,
type: ModificationGroupType,
containers: PersistentContainer[]
): ModificationGroup => {
@ -79,9 +75,9 @@ export const convert = (containers: PersistentContainer[]): ModificationGroup[]
return map(grouped, (persistentContainer, type) => {
switch (type) {
case ModificationGroupType.ShopUnitContainer:
return toGroup(GroupName.shopModification, type, persistentContainer);
return toGroup(UnitName.shopModification, type, persistentContainer);
case ModificationGroupType.ContractUnitContainer:
return toGroup(GroupName.contractModification, type, persistentContainer);
return toGroup(UnitName.contractModification, type, persistentContainer);
case ModificationGroupType.unknown:
return { type: ModificationGroupType.unknown };
}

View File

@ -1,4 +1,4 @@
export enum UnitName {
shopModification = 'shopModification',
contractModification = 'contractModification'
shopModification = 'shop_modification',
contractModification = 'contract_modification'
}