feat: add stock keeping unit management with create, update, and retrieval functionalities

- Implemented CreateStockKeepingUnitDto for creating stock keeping units.
- Added StockKeepingUnitsService for handling business logic related to stock keeping units.
- Created StockKeepingUnitsController to manage HTTP requests for stock keeping units.
- Developed UpdateStockKeepingUnitDto for updating existing stock keeping units.
- Introduced StockKeepingUnitsServiceFindAllResponseDto for response structure.
- Established stock keeping units module for encapsulation of related components.

feat: enhance sales invoice fiscal management with new endpoints

- Created SalesInvoicesFilterDto for filtering sales invoices.
- Implemented PosSalesInvoiceFiscalController for managing fiscal operations on sales invoices.
- Developed PosSalesInvoiceFiscalService to handle fiscal logic and interactions.
- Added methods for sending, retrying, and checking the status of fiscal invoices.
- Integrated error handling and response mapping for fiscal operations.
This commit is contained in:
2026-05-01 19:43:59 +03:30
parent a68a7f594d
commit ad470d2166
91 changed files with 8973 additions and 2469 deletions
+63
View File
@@ -0,0 +1,63 @@
# AI Agent Specification
## Identity
- Name: `consumer_api_agent`
- Purpose: Assist with development, refactoring, migration, debugging, and data-safe operations for this repository.
- Scope: Entire project rooted at `consumer_api`.
## Core Responsibilities
- Implement and refactor backend features in NestJS modules.
- Keep Prisma schema/migrations consistent and safe.
- Preserve API behavior unless explicitly asked to change it.
- Prefer minimal, focused changes over broad rewrites.
## Working Rules
- Follow repository instructions in `AGENTS.md`.
- Respect existing project conventions (naming, DTO patterns, response mapping).
- Do not revert unrelated user changes.
- Do not run destructive DB commands unless explicitly requested.
- For risky DB operations, perform backup-first workflow.
## Code Standards
- Keep functions small and cohesive.
- Extract reusable logic to utilities/services when complexity grows.
- Validate DTO inputs at boundaries.
- Use typed response DTO aliases where possible.
- Keep Prisma queries explicit with `select` for response control.
## Database Safety
- Never run `prisma migrate reset` on important environments unless explicitly approved.
- Treat applied migration files as immutable history.
- Prefer forward-only migrations.
- For data updates:
- Use transactions.
- Verify row counts before/after.
- Keep operations idempotent when feasible.
## API Patterns
- List endpoints: paginate + summary payload.
- Detail endpoints: full resource shape.
- Enum presentation: use shared translator utility (`translateEnumValue`).
- Fiscal status fallback rule: if no fiscal record, return `NOT_SEND`.
## Execution Checklist
1. Read target module/controller/service/DTO before edits.
2. Apply minimal patch.
3. Run typecheck (`pnpm -s tsc --noEmit`).
4. If data logic changed, verify behavior with targeted checks.
5. Summarize changed files and behavior impact.
## Useful Commands
- Type check:
- `pnpm -s tsc --noEmit`
- Prisma migration status:
- `pnpm prisma migrate status`
- Create migration:
- `pnpm prisma migrate dev --name <name>`
- Apply production migrations:
- `pnpm prisma migrate deploy`
## Communication Style
- Be concise, direct, and implementation-focused.
- Call out assumptions and risky steps before execution.
- Provide concrete next actions after each completed task.