Files
psp_api/Agents.md
T
ahasani ea6f1bfdd0 feat: add settlement_type to SalesInvoice model and related DTOs
- Added settlement_type field to SalesInvoice model with ENUM values (CASH, CREDIT, MIXED).
- Updated SalesInvoice aggregate types, input types, and where filters to include settlement_type.
- Modified StatisticsService to calculate credit amounts based on settlement_type.
- Enhanced TspProviderOriginalSendPayloadDto to include settlement_type.
- Updated NamaProvider DTOs and utility functions to handle new settlement_type logic.
- Created migration to add settlement_type column to sales_invoices table and backfill existing records.
2026-05-24 19:40:04 +03:30

1.9 KiB
Raw Blame History

AGENTS.md

Stack

  • NestJS
  • Prisma
  • TypeScript
  • pnpm
  • RTK enabled

Core Rules

  • Keep changes minimal.
  • Do not touch unrelated files.
  • Prefer existing patterns over new abstractions.
  • Preserve API behavior unless requested otherwise.
  • Prefer forward Prisma migrations.
  • Never edit applied migrations in shared environments.

EXECUTION RULES

  • Keep responses short.
  • Do not narrate thoughts.
  • Do not explain obvious steps.
  • Do not create plans for simple tasks.
  • Prefer implementation over exploration.

Avoid:

  • “I think…”
  • “Let me check…”
  • “I should inspect…”
  • “Im going to…”

RTK Rules

Always prefer RTK commands.

Use:

  • rtk ls
  • rtk grep
  • rtk smart
  • rtk read
  • rtk git diff
  • rtk git status

Avoid raw:

  • cat
  • grep
  • rg
  • git diff
  • recursive repository scans

Reading Strategy

  1. rtk grep
  2. rtk smart
  3. rtk read

Rules:

  • Read only necessary files.
  • Do not read sibling files unless needed.
  • Do not reread unchanged files.
  • Stop searching once target location is found.
  • Edit quickly after locating target.

Avoid:

  • opening entire modules
  • multi-file chained reads
  • large diff dumps
  • exploratory scans

Forbidden Paths

Do not inspect unless required:

  • node_modules/
  • dist/
  • coverage/
  • .prisma/
  • prisma/migrations/

Prisma Rules

  • Use transactions for multi-step writes.
  • Prefer explicit select/include.
  • Normalize Decimal values with Number(...).
  • Keep migrations forward-safe.
  • Use:
    • pnpm prisma migrate dev --name <name> for new local migrations
    • pnpm prisma migrate deploy for applying existing migrations

NestJS Rules

  • Keep layering:

    • controller
    • service
    • prisma/shared service
  • Reuse shared services.

  • Keep DTO validation strict.

  • Avoid any.


Validation

Typecheck before handoff:

pnpm -s tsc --noEmit