Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@angular/router": "^22.0.1",
"@ngneat/input-mask": "^6.1.0",
"@tailwindcss/postcss": "^4.3.1",
"@vality/domain-proto": "^2.0.2-c529750.0",
"@vality/domain-proto": "^2.0.2-b07c077.0",
"@vality/fistful-proto": "^2.0.1-9864622.0",
"@vality/machinegun-proto": "^1.0.1-273f2f3.0",
"@vality/magista-proto": "^2.0.2-bd58cea.0",
Expand All @@ -49,7 +49,7 @@
"keycloak-js": "^26.2.4",
"lodash-es": "^4.18.1",
"monaco-editor": "^0.55.1",
"ngx-monaco-editor-v2": "^21.1.4",
"ngx-monaco-editor-v2": "^22.0.4",
"postcss": "^8.5.15",
"rxjs": "~7.8.2",
"short-uuid": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion projects/matez/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"utility-types": "^3.11.0"
},
"dependencies": {
"@ng-matero/extensions": "^21.3.1",
"@ng-matero/extensions": "^22.0.0",
"@s-libs/js-core": "^21.0.0",
"@s-libs/micro-dash": "^21.0.0",
"@s-libs/ng-core": "^21.0.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/ng-thrift/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@vality/thrift-ts": "*",
"lodash-es": "^4.18.1",
"monaco-editor": "^0.55.1",
"ngx-monaco-editor-v2": "^21.1.4",
"ngx-monaco-editor-v2": "^22.0.4",
"rxjs": "^7.8.2",
"utility-types": "^3.11.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,14 @@ export class ComplexFormComponent<V, K = never>
});
}

handleIncomingValue(value: ComplexType<V, K>) {
if (this.isKeyValue) {
const keys = Array.from((value as Map<K, V>)?.keys() || []);
updateFormArray(this.keyControls, keys);
handleIncomingValue(value: ComplexType<V, K> | [K, V][]) {
if (!this.isKeyValue) {
updateFormArray(this.valueControls, Array.from((value as V[]) || []));
}
const values = this.isKeyValue
? Array.from(value?.values() || [])
: Array.from((value as V[]) || []);
updateFormArray(this.valueControls, values);
// When toggling between JSON and form representations, the value might arrive as an array instead of Map
const mapValue = Array.isArray(value) ? new Map(value as [K, V][]) : (value as Map<K, V>);
updateFormArray(this.keyControls, Array.from(mapValue?.keys() || []));
updateFormArray(this.valueControls, Array.from(mapValue?.values() || []));
}

override validate(): ValidationErrors | null {
Expand Down
122 changes: 89 additions & 33 deletions src/api/payment-processing/stores/parties-store.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cloneDeep } from 'lodash-es';
import { MemoizeExpiring } from 'typescript-memoize';

import { Injectable, inject } from '@angular/core';
Expand All @@ -11,6 +10,7 @@ import {
WalletID,
} from '@vality/domain-proto/domain';
import { VersionedObjectInfo } from '@vality/domain-proto/domain_config_v2';
import { getNoTimeZoneIsoString } from '@vality/matez';

import { DomainObjectsStoreService, DomainService } from '../../domain-config';

Expand Down Expand Up @@ -85,119 +85,175 @@ export class PartiesStoreService {
}

blockShop(shop: ShopConfigObject, reason: string) {
const newShopConfig = cloneDeep(shop);
newShopConfig.data.block = { blocked: { reason, since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
shop_config: newShopConfig,
shop_config: {
ref: shop.ref,
data: {
...shop.data,
block: {
blocked: {
reason,
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
]);
}

unblockShop(shop: ShopConfigObject, reason: string) {
const newShopConfig = cloneDeep(shop);
newShopConfig.data.block = { unblocked: { reason, since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
shop_config: newShopConfig,
shop_config: {
ref: shop.ref,
data: {
...shop.data,
block: {
unblocked: {
reason,
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
]);
}

suspendShop(shop: ShopConfigObject) {
const newShopConfig = cloneDeep(shop);
newShopConfig.data.suspension = { suspended: { since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
shop_config: newShopConfig,
shop_config: {
ref: shop.ref,
data: {
...shop.data,
suspension: {
suspended: { since: getNoTimeZoneIsoString(new Date()) },
},
},
},
},
},
},
]);
}

activateShop(shop: ShopConfigObject) {
const newShopConfig = cloneDeep(shop);
newShopConfig.data.suspension = { active: { since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
shop_config: newShopConfig,
shop_config: {
ref: shop.ref,
data: {
...shop.data,
suspension: {
active: { since: getNoTimeZoneIsoString(new Date()) },
},
},
},
},
},
},
]);
}

blockWallet(wallet: WalletConfigObject, reason: string) {
const newWalletConfig = cloneDeep(wallet);
newWalletConfig.data.block = { blocked: { reason, since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
wallet_config: newWalletConfig,
wallet_config: {
ref: wallet.ref,
data: {
...wallet.data,
block: {
blocked: {
reason,
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
]);
}

unblockWallet(wallet: WalletConfigObject, reason: string) {
const newWalletConfig = cloneDeep(wallet);
newWalletConfig.data.block = { unblocked: { reason, since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
wallet_config: newWalletConfig,
wallet_config: {
ref: wallet.ref,
data: {
...wallet.data,
block: {
unblocked: {
reason,
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
]);
}

suspendWallet(wallet: WalletConfigObject) {
const newWalletConfig = cloneDeep(wallet);
newWalletConfig.data.suspension = { suspended: { since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
wallet_config: newWalletConfig,
wallet_config: {
ref: wallet.ref,
data: {
...wallet.data,
suspension: {
suspended: {
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
]);
}

activateWallet(wallet: WalletConfigObject) {
const newWalletConfig = cloneDeep(wallet);
newWalletConfig.data.suspension = { active: { since: new Date().toISOString() } };

return this.domainService.commit([
{
update: {
object: {
wallet_config: newWalletConfig,
wallet_config: {
ref: wallet.ref,
data: {
...wallet.data,
suspension: {
active: {
since: getNoTimeZoneIsoString(new Date()),
},
},
},
},
},
},
},
Expand Down
Loading