Files
psp_api/prisma/migrations/20260425075045_init/migration.sql
T
ahasani b72e6c7194 feat: refactor ComplexPosesService to remove unused defaultInsert method and improve findAll logic
fix: update PartnersService to use 'isNot' instead of 'not' for allocation checks

refactor: enhance BusinessActivityComplexesService to validate license activation before creating a complex

fix: adjust ComplexPosesService to ensure account allocation checks are accurate and handle errors properly

refactor: modify ConsumerMiddleware to set consumerData instead of partnerData for better clarity

feat: expand SaleInvoicesService to include additional fields in the invoice selection

chore: update business-activities module to include accounts-charge module for better organization

fix: ensure ComplexPosesService correctly handles account allocation during POS creation

feat: implement PartnerBusinessActivityAccountsCharge module with create functionality for account charges

refactor: streamline getPartnerBusinessActivityAllocationLimits utility for better clarity and functionality

chore: add migration script to update database schema with necessary constraints and foreign keys

feat: create DTO for accounts charge to validate incoming data
2026-04-25 15:16:59 +03:30

54 lines
2.4 KiB
SQL

/*
Warnings:
- You are about to drop the column `allocation_id` on the `partner_account_quota_credit` table. All the data in the column will be lost.
- A unique constraint covering the columns `[economic_code,consumer_id]` on the table `business_activities` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[credit_id]` on the table `license_account_allocation` will be added. If there are existing duplicate values, this will fail.
- Made the column `account_id` on table `poses` required. This step will fail if there are existing NULL values in that column.
*/
-- DropForeignKey
ALTER TABLE `license_renew` DROP FOREIGN KEY `license_renew_activation_id_fkey`;
-- DropForeignKey
ALTER TABLE `partner_account_quota_credit` DROP FOREIGN KEY `partner_account_quota_credit_allocation_id_fkey`;
-- DropForeignKey
ALTER TABLE `poses` DROP FOREIGN KEY `poses_account_id_fkey`;
-- DropIndex
DROP INDEX `business_activities_economic_code_key` ON `business_activities`;
-- DropIndex
DROP INDEX `license_renew_activation_id_fkey` ON `license_renew`;
-- DropIndex
DROP INDEX `partner_account_quota_credit_allocation_id_key` ON `partner_account_quota_credit`;
-- AlterTable
ALTER TABLE `license_account_allocation` ADD COLUMN `credit_id` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `license_renew` MODIFY `activation_id` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `partner_account_quota_credit` DROP COLUMN `allocation_id`;
-- AlterTable
ALTER TABLE `poses` MODIFY `account_id` VARCHAR(191) NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `business_activities_economic_code_consumer_id_key` ON `business_activities`(`economic_code`, `consumer_id`);
-- CreateIndex
CREATE UNIQUE INDEX `license_account_allocation_credit_id_key` ON `license_account_allocation`(`credit_id`);
-- AddForeignKey
ALTER TABLE `poses` ADD CONSTRAINT `poses_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `license_renew` ADD CONSTRAINT `license_renew_activation_id_fkey` FOREIGN KEY (`activation_id`) REFERENCES `licenses_activated`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `license_account_allocation` ADD CONSTRAINT `license_account_allocation_credit_id_fkey` FOREIGN KEY (`credit_id`) REFERENCES `partner_account_quota_credit`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;