Files
psp_api/prisma/migrations/20260505072900_update_invoice_to_ref/migration.sql
T
ahasani 658496320b feat: implement correction and original send functionality for Nama provider
- Added new DTOs for correction requests and responses in `nama-provider.dto.ts`.
- Updated `nama-provider.adapter.ts` to include `originalSend` and `correctionSend` methods.
- Enhanced `nama-provider.util.ts` with mapping functions for correction requests.
- Created operational guidelines for agents in `AGENT.md`.
- Updated Prisma migrations to support new invoice types and relationships.
- Introduced new service and DTO for creating sales invoices in `sale-invoice-create.service.ts` and `sale-invoice-create.dto.ts`.
- Added utility for handling Prisma errors in `prisma-error.util.ts`.
2026-05-05 22:42:09 +03:30

25 lines
1.1 KiB
SQL

/*
Warnings:
- You are about to drop the column `type` on the `sale_invoice_tsp_attempts` table. All the data in the column will be lost.
- A unique constraint covering the columns `[ref_id]` on the table `sales_invoices` will be added. If there are existing duplicate values, this will fail.
- Added the required column `type` to the `sales_invoices` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `sale_invoice_tsp_attempts` DROP COLUMN `type`;
-- AlterTable
ALTER TABLE `sales_invoices` ADD COLUMN `main_id` VARCHAR(50) NULL,
ADD COLUMN `ref_id` VARCHAR(50) NULL,
ADD COLUMN `type` ENUM('ORIGINAL', 'CORRECTION', 'REVOKE', 'RETURN') NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `sales_invoices_ref_id_key` ON `sales_invoices`(`ref_id`);
-- CreateIndex
CREATE INDEX `sales_invoices_ref_id_idx` ON `sales_invoices`(`ref_id`);
-- AddForeignKey
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_ref_id_fkey` FOREIGN KEY (`ref_id`) REFERENCES `sales_invoices`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;