Referans · dosya-dosya

packages/FinevoConnect.Yos.Shared — Ortak Çekirdek

İki uygulamanın paylaştığı tek doğruluk kaynağı: varlıklar (durum makineleri), enum'lar, sabitler, arayüzler, model'ler ve EF şeması. Tüm ID'ler tipli (UserId, HhsConnectionId...) ve düz-string olarak serileştirilir.

Varlıklar (durum makineleri)

Her varlık, geçersiz durum geçişlerini engelleyen guard'lı metotlara sahiptir.

HhsConnectionEntities · tablo HhsConnections

Bir kullanıcının bir bankaya/kuruma rızası (durum makinesi). Şifreli token'lar (owned PaymentConsentTokenSet), GroupId, RowVersion. (UserId,HhsId) 'connected' filtered unique.

MarkConsentCreated / MarkAuthorized / MarkConnected / MarkConvertedToOrder / MarkCancelled(detay kodu) / MarkExpired / MarkFailed / MarkConsentStatusSynced / IsConnected
Bağlı: → User, Hhs; ← Account/Card/Payment/Permission
SyncIntentEntities · tablo SyncIntents

Niyet kutusu (outbox). Payload (JSON, polymorphic), GroupId, TraceId, AttemptCount. Index (Status,NextAttemptTime,CreateTime).

MarkDispatched (AttemptCount++) / MarkConsumed / MarkRetryScheduled(reason,next) / MarkDead(reason)
Bağlı: → HhsConnection
ClientApplication + User + RefreshTokenEntities · Applications/Users/RefreshTokens

İstemci uygulama (AppKeyHash — X-App-Key ile doğrulanır; AllowedRedirectHosts — istekle gelen dönüş adresleri için izinli host listesi, noktalı virgül ayrık, en fazla 10) + kullanıcı (ApplicationId + UserKey + CustomerNo benzersiz üçlüsü, tercih dili) + yenileme token'ları.

ClientApplication: RotateKey / Suspend / IsActive / SetAllowedRedirectHosts / IsRedirectHostAllowed
User: Suspend / IsActive
RefreshToken: IsActive(now) / Revoke(now)
Bağlı: → HhsConnection/Payment; User→ClientApplication; RefreshToken→User
HhsEntities · tablo Hhs

Banka/Kurum ana verisi: kod, ad, BaseUrl, JWKS URL, YÖS kod, olay-abonelik referansı.

Enable / Disable / SetEventSubscriptionReference / IsEnabled
Bağlı: ← HhsConnection
Account + TransactionEntities · Accounts/Transactions

Hesap (IBAN maskeli+şifreli, owned Balance, senkron zamanları) + işlem geçmişi (KeysetSeq sayfalama, yön).

Account: SyncSnapshot / MarkTransactionsSynced
Bağlı: → HhsConnection; Transaction→Account
Card + alt tablolarEntities · Cards/CardDetail/...

Kart (maskeli PAN, tür/segment) + detay + işlem + ekstre-tipi + taksit + puan (5 alt tablo).

Card: SyncSnapshot
Bağlı: → HhsConnection
PaymentOrderEntities · PaymentOrders

Ödeme emri (durum makinesi); alıcı bilgisi (şifreli IBAN), tutar, PaymentSystem (banka/kurum belirler), idempotency key unique, keyset.

MarkConsentCreated / StoreTokens / MarkSubmitted(ref,status,odmStm) / UpdateStatus / MarkFailed
Bağlı: → User, HhsConnection, Account
RecurringPayment + ExecutionEntities · RecurringPayments

Düzenli ödeme talimatı (sıklık, ödeme sayısı, sonraki tarih) + her gerçekleşme kaydı.

AttachInstruction / SyncStatus / Cancel / Complete / MarkFailed
Bağlı: → User, HhsConnection
ForwardDatedPaymentEntities · ForwardDatedPayments

İleri tarihli ödeme (planlanan tarih, durum makinesi).

AttachInstruction / MarkExecuted / Cancel / SyncStatus / MarkFailed
Bağlı: → User, HhsConnection
HhsQueryQuotaEntities · HhsQueryQuotas

Bağlantı+sorgu-tipi başına kota penceresi (CallCount/Limit, WindowStart/ResetTime).

RegisterCall / IsExhausted
Bağlı: → HhsConnection
Outbox / OutboxConsumed / Idempotency / AuditLogEntities · altyapı

Olay yayını + tüketim işareti; Idempotency (key+user PK, reserve→complete); denetim izi.

Outbox: MarkInFlight/Delivered/Retry/Dead
Idempotency: Complete / IsCompleted
Bağlı: org altyapı

Enum'lar (yaşam döngüsü + protokol)

EnumDeğerler / akış
ConnectionStatusPending → Authorized → Connected → ConvertedToOrder / Cancelled / Expired / Failed
SyncIntentStatusPending → Dispatched → Consumed / Failed
PaymentOrderStatusPending → ApprovedPending → Sent → Processing → Completed / PartiallyCompleted / Cancelled / Failed
RecurringPaymentStatusPendingAuthorization / Active / Paused / Cancelled / Completed / Failed
ForwardDatedPaymentStatusPendingAuthorization → Scheduled → Executed / Failed / Cancelled
ConsentTypeAccountInformation / Payment / Recurring / ForwardDated
GkdMethodRedirect / Decoupled
IdentityTypeTckn / Vkn / Mno / Ykn / Pno
PsuInitiator → wireUserPresent=E · HhsInitiated=O · Autonomous=H
RefreshReason → PSUUserRequested→E · Autonomous→H · EventTriggered→O
LiveQueryKindAccounts / AccountTransactions / Cards / CardDetail / CardTransactions / ConnectionStatus
SyncIntentKindConsentCreate / AuthorizationComplete / InitialFetch / BalanceRefresh / TransactionRefresh / CardRefresh / ConsentStatusSync / PaymentOrderSubmit / *AuthorizationComplete / *Cancel / RecurringPlanSync / ForwardDatedStatusSync ...
OhvpsPermissionBasicAccount(01) / DetailedAccount(02) / Balance(03) / BasicTransaction(04) / DetailedTransaction(05) / RealtimeBalance(06) / CardInfo(07) / DetailedCardInfo(08) / CardTransaction(09)
TransactionDirectionDebit / Credit / Neutral
DataFreshnessLive / Cached / Stale

Sabit aileleri (Domain/Constants)

İş kodunda çıplak string/sayı yok — her değer tipli bir sabitin arkasında (ADR-YOS-055 istisnası: public route template'leri düz literal).

OhvpsPathsConstants/Api

ÖHVPS wire path'leri (EN const adı ↔ TR path). HBH: erisim-belirteci, hesap-bilgisi-rizasi, hesaplar, bakiye, kartlar, islemler, yetkilendirme-kodu, olay-abonelik. OBH: odeme-emri-rizasi, odeme-emri, duzenli-*, ileri-tarihli-*.

Bağlı: batch Integration
OhvpsPsuValuesConstants/Api

psuInitiated wire: UserPresent=E, HhsInitiated=O, Autonomous=H + PsuInitiatorToWire sözlüğü.

Bağlı: OhvpsAuthHandler
ApiHeadersConstants/Api

Idempotency-Key, x-request-id, x-group-id, X-ASPSP/TPP-Code, x-jws-signature, PSU-* , X-Internal-Secret.

Bağlı: middleware + handler
YosErrorCodesConstants/Errors

49 hata kodu (dot.snake_case) — error.redirect_url.{invalid,host_not_allowed} dahil. Errors.{tr,en}.json ile eşleşir.

Bağlı: ExceptionHandlingMiddleware, ErrorLocalizer
ConfigKeysConstants/Configuration

Env/config anahtarları: JWT_SIGNING_KEY, OHVPS_*, BATCH_LIVE_QUERY_*, DataProtection.

Bağlı: DI + Program.cs
Limits aileleriConstants/Limits

ConsentLimits (yetki-timeout, erişim-ay), PaymentLimits (tutar, min-ödeme-sayısı), OhvpsQueryLimits (kota tavanları + pencere), ConsumerRedirectLimits (URL 2048, host 10, ';' ayraç), LiveFetchWaitLimits, PagingLimits.

Bağlı: servisler + kota
OhvpsPermissionRules / OhvpsQueryWindowRules / ConsumerRedirectUrlRulesCommon

İzin bağımlılık kuralları (01/07 zorunlu, 05→04, 06→03...) + işlem sorgu penceresi (PSU-present bireysel 6ay/kurumsal 12ay; sistem 24s; ±12ay çapa) + dönüş adresi biçim kuralları (mutlak URL, ≤2048, https — http yalnız localhost).

Bağlı: consent create + transaction + redirect validator

Arayüzler (Abstractions)

Repository arayüzleri (~20)Abstractions/Repositories

IHhsConnectionRepository, ISyncIntentRepository, IAccountRepository, ICardRepository, IPaymentOrderRepository, IHhsQueryQuotaRepository, IIdempotencyStore, IOutboxStore, IInboundEventStore... Veri erişimi.

Bağlı: impl: api + batch Persistence
Servis arayüzleriAbstractions/Services

IHhsConnectionService, IAccountAggregationService, ICardService, I*PaymentService, ISyncIntentService, ILiveRefreshCoordinator, IConsentActivationService, ILiveQueryService, IConnectionSyncService.

Bağlı: impl: api Application / batch Application
Entegrasyon arayüzleriAbstractions/Integration

IOhvps{Consent,Account,Payment,Token,Event}Client(+Factory), IJwsSigner/Verifier, IOhvpsRequestContext, ILiveQueryClient, IHhsResolver, IYosCallbackUrlProvider.

Bağlı: impl: batch Integration (+ api LiveQueryClient)
Yardımcı arayüzleriAbstractions

IClock, IIdGenerator, ITokenProtector, ICurrentUser, IUnitOfWork, IAppKeyHasher, IJwtTokenGenerator, IFeatureFlags, IExceptionLogger.

Bağlı: impl: Infrastructure

Persistence (FinevoConnect.Yos.Shared.Persistence)

AppDbContext + 25 tablo

EF Core 10 code-first. Her tablo bir IEntityTypeConfiguration. Tam PascalCase (tablo+kolon). datetime2(7), decimal(18,2), enum nvarchar + HasConversion<string>.

Eşzamanlılık + indeks

RowVersion (iyimser kilit), keyset sayfalama indeksleri (KeysetSeq), filtered unique (rıza 'connected', idempotency key). Owned tipler: PaymentConsentTokenSet, Balance.