Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-05-10 09:44:49 +03:30
parent 4e61ff618e
commit afa83895a2
28 changed files with 1663 additions and 2186 deletions
@@ -0,0 +1,32 @@
/*
Warnings:
- You are about to drop the `consumer_devices` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `consumer_devices` DROP FOREIGN KEY `consumer_devices_consumer_id_fkey`;
-- DropTable
DROP TABLE `consumer_devices`;
-- CreateTable
CREATE TABLE `consumer_account_device` (
`id` VARCHAR(191) NOT NULL,
`device_id` VARCHAR(191) NOT NULL,
`device_name` VARCHAR(191) NULL,
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` TIMESTAMP(0) NOT NULL,
`consumer_account_id` VARCHAR(191) NOT NULL,
UNIQUE INDEX `consumer_account_device_device_id_key`(`device_id`),
UNIQUE INDEX `consumer_account_device_consumer_account_id_key`(`consumer_account_id`),
INDEX `consumer_account_device_consumer_account_id_idx`(`consumer_account_id`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `consumer_account_device` ADD CONSTRAINT `consumer_account_device_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `sale_invoice_tsp_attempts` ADD CONSTRAINT `sale_invoice_tsp_attempts_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;