<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Caio Vinicius</title>
    <description>The latest articles on DEV Community by Caio Vinicius (@caio_vinicius_967143f7edf).</description>
    <link>https://dev.to/caio_vinicius_967143f7edf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4015211%2Fc94c119b-bd89-4e48-b868-b57892f1c776.png</url>
      <title>DEV Community: Caio Vinicius</title>
      <link>https://dev.to/caio_vinicius_967143f7edf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/caio_vinicius_967143f7edf"/>
    <language>en</language>
    <item>
      <title>How do you generate "virtual" recurring transaction projections in a backend?</title>
      <dc:creator>Caio Vinicius</dc:creator>
      <pubDate>Sat, 04 Jul 2026 15:31:46 +0000</pubDate>
      <link>https://dev.to/caio_vinicius_967143f7edf/how-do-you-generate-virtual-recurring-transaction-projections-in-a-backend-2b03</link>
      <guid>https://dev.to/caio_vinicius_967143f7edf/how-do-you-generate-virtual-recurring-transaction-projections-in-a-backend-2b03</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;Stack: Node.js / Nuxt (Nitro) backend, TypeScript, PostgreSQL. DB schema is already settled, so I'm not looking for feedback on that — I need help with the backend implementation logic itself.&lt;/p&gt;

&lt;p&gt;Context: personal finance app. A &lt;code&gt;recurrences&lt;/code&gt; table stores rules (amount, frequency, due day, total installments if applicable, start date). Real transactions live in a separate &lt;code&gt;transactions&lt;/code&gt; table with a nullable &lt;code&gt;recurrence_id&lt;/code&gt; FK. Future occurrences are NOT pre-generated in the DB — they should be calculated on demand as "virtual" projections (e.g. "show me all transactions, real + projected, for July 2026"), and only turned into a real row when the date arrives or the user confirms it.&lt;/p&gt;

&lt;p&gt;What I need help with, specifically:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How would you structure the function/service that takes a recurrence rule + a date range and returns the list of projected occurrences? Any concrete approach or pseudocode.&lt;/li&gt;
&lt;li&gt;Would you reach for a library (date-fns, rrule.js, luxon) to generate the occurrence dates, or roll your own date math? If a library, which one and why.&lt;/li&gt;
&lt;li&gt;How do you merge real transactions and virtual projections into a single list for the frontend without confusing the two (flags, separate response shape, IDs)?&lt;/li&gt;
&lt;li&gt;Once a projection needs to become a real row (date arrives, or user confirms), what's a clean way to do that without duplicating logic between the "projection calculator" and the "materializer"?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not looking for database/schema advice — just the backend implementation approach. Any pseudocode, patterns, or library recommendations are welcome. Thanks!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>discuss</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
