Refactor Partner and POS models to replace 'serial' with 'serial_number' and update related services and DTOs

- Updated PartnerAccountQuotaAllocation model to change license relation.
- Refactored Pos model to replace 'serial' with 'serial_number' across all references.
- Modified BusinessActivitiesService to include license activation details in responses.
- Adjusted ComplexPosesService to reflect changes in the Pos model.
- Updated PartnerService to include a new method for updating partner profiles.
- Created UpdatePartnerProfileDto for partner profile updates.
- Added migration to drop 'serial' column and add unique 'serial_number' column in poses table.
This commit is contained in:
2026-04-24 02:20:15 +03:30
parent a350ec7990
commit 11488093a7
26 changed files with 285 additions and 173 deletions
@@ -0,0 +1,16 @@
/*
Warnings:
- You are about to drop the column `serial` on the `poses` table. All the data in the column will be lost.
- A unique constraint covering the columns `[serial_number]` on the table `poses` will be added. If there are existing duplicate values, this will fail.
*/
-- DropIndex
DROP INDEX `poses_serial_key` ON `poses`;
-- AlterTable
ALTER TABLE `poses` DROP COLUMN `serial`,
ADD COLUMN `serial_number` VARCHAR(191) NULL;
-- CreateIndex
CREATE UNIQUE INDEX `poses_serial_number_key` ON `poses`(`serial_number`);
+6 -6
View File
@@ -85,12 +85,12 @@ model Complex {
}
model Pos {
id String @id @default(ulid())
name String
serial String @unique()
model String?
status POSStatus @default(ACTIVE)
pos_type POSType
id String @id @default(ulid())
name String
model String?
serial_number String? @unique()
status POSStatus @default(ACTIVE)
pos_type POSType
created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @updatedAt() @db.Timestamp(0)
+3 -3
View File
@@ -1,6 +1,6 @@
model License {
id String @id @default(ulid())
accounts_limit Int @default(3)
accounts_limit Int @default(2)
created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @updatedAt() @db.Timestamp(0)
@@ -8,8 +8,8 @@ model License {
charge_transaction_id String
charge_transaction LicenseChargeTransaction @relation(fields: [charge_transaction_id], references: [id])
activation LicenseActivation?
allocations PartnerAccountQuotaAllocation[]
activation LicenseActivation?
account_allocations PartnerAccountQuotaAllocation[]
@@map("licenses")
}
+5 -4
View File
@@ -15,10 +15,11 @@ model PartnerAccount {
}
model Partner {
id String @id @default(ulid())
name String
code String @unique()
status PartnerStatus @default(ACTIVE)
id String @id @default(ulid())
name String
code String @unique()
status PartnerStatus @default(ACTIVE)
logo_url String?
created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)
-1
View File
@@ -381,7 +381,6 @@ async function main() {
create: {
name: 'لاین ۱',
pos_type: POSType.WEB,
serial: '12312312',
status: 'ACTIVE',
},
},