Skip to content

cs transaction shared ​

Experience · Package · Active

cs transaction shared

Local shared package for CS Transaction Manage contracts and TypeScript types consumed by the BFF and frontend.

  • TypeScript

Spec sheet

Package name

@casa-srl/shared

Repository path

cs-transacion-manage/packages/shared

Runtime

TypeScript package

Responsibilities

  • Keep API and frontend DTO contracts aligned inside the product repo.
  • Expose PlanningSetupStatus and PlanningSetupRequest without a workspace access-gate flag.
  • Emit dist artifacts for package consumers during local-stack watch mode.
  • Avoid promoting product-specific contracts to platform-shared-packages prematurely.

Interfaces and contract surface

  • Package export @casa-srl/shared

Consumers

Notes

  • Promote contracts to platform-shared-packages only when more than one repository consumes them.

Source references

  • cs-transacion-manage/packages/shared/package.json
  • cs-transacion-manage/packages/shared/src

Access types ​

Il package esporta i tipi locali AccessRole, SubscriptionTier, AccessCapability e AccessContext. AuthResponse include user.role e access, cosi BFF e frontend restano allineati sulla matrice subscription-aware del prodotto.

Classificazione finanziaria ​

Il contratto condiviso espone FinancialNature, FinancialNatureSource e TransactionPeriodicity.

La periodicità è derivata, non persistita come duplicato: una ricorrenza con origine in TransactionSeries è RECURRING; un movimento senza serie è EXTRAORDINARY. Le sorgenti della natura sono DIRECT, SERIES_INHERITED, INVESTMENT_DERIVED e SYSTEM_DERIVED.

La matrice applicabile è composta da otto celle:

PeriodicitàEntrata attivaEntrata passivaUscita di mantenimentoUscita di investimento
RECURRINGattiva ricorrentepassiva ricorrentemantenimento ricorrenteinvestimento ricorrente
EXTRAORDINARYattiva straordinariapassiva straordinariamantenimento straordinarioinvestimento straordinario

La direzione limita la natura: CREDIT accetta ACTIVE o PASSIVE, mentre DEBT accetta MAINTENANCE o INVESTMENT. I read model espongono sempre financialNature, financialNatureSource e periodicity.

Investment è un asset e non contiene una natura finanziaria. Gli interessi materializzati sono entrate PASSIVE; il rimborso del capitale è passivo, straordinario e non contribuisce alla copertura della libertà, pur restando nel cash flow complessivo.

Gamification ​

Il package esporta i contratti GamificationSummary, GamificationRuleCode, GamificationSourceType e le funzioni pure per valutare saldi puntuali, completamenti mensili, livelli, streak e badge. Le regole non usano importi come criterio di merito e lavorano sul tempo finanziario Europe/Rome.

Workspace reference: /Users/jeanpaul/projects/cs-repository