Files
psp_api/prisma/migrations/20260422200730_init/migration.sql
T
ahasani a350ec7990 feat: add consumer accounts and business activities management
- Implemented AccountsService for managing consumer accounts including create, update, delete, and find operations.
- Created DTOs for account creation and updates.
- Developed BusinessActivitiesController and BusinessActivitiesService for handling business activities related to consumers.
- Added complexes management with ComplexesController and ComplexesService.
- Introduced POS management with ComplexPosesController and ComplexPosesService.
- Created necessary DTOs for business activities and POS.
- Established Licenses management with LicensesController and LicensesService.
- Integrated consumer management with PartnerConsumersController and PartnerConsumersService.
- Added Prisma module imports and service connections across modules.
2026-04-23 20:59:39 +03:30

36 lines
1.8 KiB
SQL

/*
Warnings:
- You are about to drop the column `tax_id` on the `complexes` table. All the data in the column will be lost.
- A unique constraint covering the columns `[economic_code]` on the table `business_activities` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[mobile_number,national_code,partner_id]` on the table `consumers` will be added. If there are existing duplicate values, this will fail.
- Added the required column `economic_code` to the `business_activities` table without a default value. This is not possible if the table is not empty.
- Added the required column `national_code` to the `consumers` table without a default value. This is not possible if the table is not empty.
- Added the required column `partner_id` to the `consumers` table without a default value. This is not possible if the table is not empty.
*/
-- DropIndex
DROP INDEX `consumers_mobile_number_key` ON `consumers`;
-- AlterTable
ALTER TABLE `business_activities` ADD COLUMN `economic_code` VARCHAR(191) NOT NULL;
-- AlterTable
ALTER TABLE `complexes` DROP COLUMN `tax_id`;
-- AlterTable
ALTER TABLE `consumers` ADD COLUMN `national_code` VARCHAR(191) NOT NULL,
ADD COLUMN `partner_id` VARCHAR(191) NOT NULL;
-- AlterTable
ALTER TABLE `licenses` ADD COLUMN `accounts_limit` INTEGER NOT NULL DEFAULT 3;
-- CreateIndex
CREATE UNIQUE INDEX `business_activities_economic_code_key` ON `business_activities`(`economic_code`);
-- CreateIndex
CREATE UNIQUE INDEX `consumers_mobile_number_national_code_partner_id_key` ON `consumers`(`mobile_number`, `national_code`, `partner_id`);
-- AddForeignKey
ALTER TABLE `consumers` ADD CONSTRAINT `consumers_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;