feat: add response DTOs for various services across modules
- Created response DTOs for ConfigService, AppService, AuthService, CatalogsService, AccountsService, BusinessActivityComplexesService, ComplexPosesService, SalesInvoicesService, BusinessActivitiesService, ConsumerBusinessActivityGoodsService, and others. - Implemented Create, FindAll, FindOne, and Update response types for services in consumer, partners, and POS modules. - Added request DTOs for creating and updating goods in the consumer business activities module. - Introduced filtering DTO for partner licenses. - Enhanced response mapping for partner license activations.
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `complex_id` on the `customer_individuals` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `complex_id` on the `customer_legal` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `unknown_customer` on the `customers` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `complex_id` on the `goods` table. All the data in the column will be lost.
|
||||
- A unique constraint covering the columns `[business_activity_id,national_id]` on the table `customer_individuals` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[business_activity_id,economic_code]` on the table `customer_legal` will be added. If there are existing duplicate values, this will fail.
|
||||
- Added the required column `business_activity_id` to the `customer_individuals` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `mobile_number` to the `customer_individuals` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `business_activity_id` to the `customer_legal` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `customer_individuals` DROP FOREIGN KEY `customer_individuals_complex_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `customer_legal` DROP FOREIGN KEY `customer_legal_complex_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `goods` DROP FOREIGN KEY `goods_complex_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `customer_individuals_complex_id_idx` ON `customer_individuals`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `customer_individuals_complex_id_national_id_key` ON `customer_individuals`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `customer_legal_complex_id_idx` ON `customer_legal`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `customer_legal_complex_id_registration_number_key` ON `customer_legal`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `goods_complex_id_fkey` ON `goods`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `customer_individuals` DROP COLUMN `complex_id`,
|
||||
ADD COLUMN `business_activity_id` VARCHAR(191) NOT NULL,
|
||||
ADD COLUMN `mobile_number` CHAR(15) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `customer_legal` DROP COLUMN `complex_id`,
|
||||
ADD COLUMN `business_activity_id` VARCHAR(191) NOT NULL,
|
||||
MODIFY `registration_number` CHAR(20) NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `customers` DROP COLUMN `unknown_customer`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `goods` DROP COLUMN `complex_id`,
|
||||
ADD COLUMN `business_activity_id` VARCHAR(191) NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX `customer_individuals_business_activity_id_idx` ON `customer_individuals`(`business_activity_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `customer_individuals_business_activity_id_national_id_key` ON `customer_individuals`(`business_activity_id`, `national_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX `customer_legal_business_activity_id_idx` ON `customer_legal`(`business_activity_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `customer_legal_business_activity_id_economic_code_key` ON `customer_legal`(`business_activity_id`, `economic_code`);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
Consumer profile split migration.
|
||||
|
||||
Existing profile data is copied into `individual_consumers` before the source
|
||||
columns are removed from `consumers`.
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `consumers`
|
||||
ADD COLUMN `type` ENUM('INDIVIDUAL', 'LEGAL') NOT NULL DEFAULT 'INDIVIDUAL';
|
||||
|
||||
UPDATE `consumers` SET `type` = 'INDIVIDUAL';
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `consumers` DROP FOREIGN KEY `consumers_partner_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `consumers_mobile_number_partner_id_key` ON `consumers`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `consumers_national_code_partner_id_key` ON `consumers`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `consumers_partner_id_fkey` ON `consumers`;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `individual_consumers` (
|
||||
`first_name` VARCHAR(191) NOT NULL,
|
||||
`last_name` VARCHAR(191) NOT NULL,
|
||||
`mobile_number` VARCHAR(191) NOT NULL,
|
||||
`national_code` VARCHAR(191) NOT NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`partner_id` VARCHAR(191) NOT NULL,
|
||||
`consumer_id` VARCHAR(191) NOT NULL,
|
||||
UNIQUE INDEX `individual_consumers_mobile_number_consumer_id_key` (
|
||||
`mobile_number`,
|
||||
`consumer_id`
|
||||
),
|
||||
UNIQUE INDEX `individual_consumers_partner_id_national_code_key` (`partner_id`, `national_code`),
|
||||
PRIMARY KEY (`consumer_id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `legal_consumers` (
|
||||
`name` VARCHAR(191) NOT NULL,
|
||||
`registration_code` VARCHAR(191) NOT NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`partner_id` VARCHAR(191) NOT NULL,
|
||||
`consumer_id` VARCHAR(191) NOT NULL,
|
||||
UNIQUE INDEX `legal_consumers_partner_id_registration_code_key` (
|
||||
`partner_id`,
|
||||
`registration_code`
|
||||
),
|
||||
PRIMARY KEY (`consumer_id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO
|
||||
`individual_consumers` (
|
||||
`first_name`,
|
||||
`last_name`,
|
||||
`mobile_number`,
|
||||
`national_code`,
|
||||
`created_at`,
|
||||
`updated_at`,
|
||||
`partner_id`,
|
||||
`consumer_id`
|
||||
)
|
||||
SELECT
|
||||
`first_name`,
|
||||
`last_name`,
|
||||
`mobile_number`,
|
||||
`national_code`,
|
||||
`created_at`,
|
||||
`updated_at`,
|
||||
`partner_id`,
|
||||
`id`
|
||||
FROM `consumers`;
|
||||
|
||||
ALTER TABLE `consumers`
|
||||
DROP COLUMN `first_name`,
|
||||
DROP COLUMN `last_name`,
|
||||
DROP COLUMN `mobile_number`,
|
||||
DROP COLUMN `national_code`,
|
||||
DROP COLUMN `partner_id`,
|
||||
MODIFY `type` ENUM('INDIVIDUAL', 'LEGAL') NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `individual_consumers`
|
||||
ADD CONSTRAINT `individual_consumers_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `individual_consumers`
|
||||
ADD CONSTRAINT `individual_consumers_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `legal_consumers`
|
||||
ADD CONSTRAINT `legal_consumers_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `legal_consumers`
|
||||
ADD CONSTRAINT `legal_consumers_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE `individual_consumers` RENAME TO `consumers_individual`;
|
||||
ALTER TABLE `legal_consumers` RENAME TO `consumers_legal`;
|
||||
|
||||
ALTER TABLE `consumers_individual`
|
||||
RENAME INDEX `individual_consumers_mobile_number_consumer_id_key` TO `consumers_individual_mobile_number_consumer_id_key`;
|
||||
ALTER TABLE `consumers_individual`
|
||||
RENAME INDEX `individual_consumers_partner_id_national_code_key` TO `consumers_individual_partner_id_national_code_key`;
|
||||
ALTER TABLE `consumers_legal`
|
||||
RENAME INDEX `legal_consumers_partner_id_registration_code_key` TO `consumers_legal_partner_id_registration_code_key`;
|
||||
|
||||
ALTER TABLE `consumers_individual` DROP FOREIGN KEY `individual_consumers_partner_id_fkey`;
|
||||
ALTER TABLE `consumers_individual` DROP FOREIGN KEY `individual_consumers_consumer_id_fkey`;
|
||||
ALTER TABLE `consumers_legal` DROP FOREIGN KEY `legal_consumers_partner_id_fkey`;
|
||||
ALTER TABLE `consumers_legal` DROP FOREIGN KEY `legal_consumers_consumer_id_fkey`;
|
||||
|
||||
ALTER TABLE `consumers_individual`
|
||||
ADD CONSTRAINT `consumers_individual_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `consumers_individual_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `consumers_legal`
|
||||
ADD CONSTRAINT `consumers_legal_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `consumers_legal_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -23,7 +23,7 @@ model Admin {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
adminAccounts AdminAccount[]
|
||||
accounts AdminAccount[]
|
||||
|
||||
@@map("admins")
|
||||
}
|
||||
|
||||
@@ -20,12 +20,27 @@ model ConsumerAccount {
|
||||
}
|
||||
|
||||
model Consumer {
|
||||
id String @id @default(ulid())
|
||||
mobile_number String
|
||||
national_code String
|
||||
id String @id @default(ulid())
|
||||
type ConsumerType
|
||||
status ConsumerStatus @default(ACTIVE)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
accounts ConsumerAccount[]
|
||||
business_activities BusinessActivity[]
|
||||
devices ConsumerDevices[]
|
||||
individual ConsumerIndividual?
|
||||
legal ConsumerLegal?
|
||||
|
||||
@@map("consumers")
|
||||
}
|
||||
|
||||
model ConsumerIndividual {
|
||||
first_name String
|
||||
last_name String
|
||||
status ConsumerStatus @default(ACTIVE)
|
||||
mobile_number String
|
||||
national_code String
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
@@ -33,13 +48,29 @@ model Consumer {
|
||||
partner_id String
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumer_accounts ConsumerAccount[]
|
||||
business_activities BusinessActivity[]
|
||||
consumer_devices ConsumerDevices[]
|
||||
consumer_id String @id
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([mobile_number, partner_id])
|
||||
@@unique([national_code, partner_id])
|
||||
@@map("consumers")
|
||||
@@unique([mobile_number, consumer_id])
|
||||
@@unique([partner_id, national_code])
|
||||
@@map("consumers_individual")
|
||||
}
|
||||
|
||||
model ConsumerLegal {
|
||||
name String
|
||||
registration_code String
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
partner_id String
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumer_id String @id
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([partner_id, registration_code])
|
||||
@@map("consumers_legal")
|
||||
}
|
||||
|
||||
model BusinessActivity {
|
||||
@@ -59,6 +90,9 @@ model BusinessActivity {
|
||||
complexes Complex[]
|
||||
permission_businesses PermissionBusiness[]
|
||||
license_activation LicenseActivation?
|
||||
goods Good[]
|
||||
customer_individuals CustomerIndividual[]
|
||||
customer_legals CustomerLegal[]
|
||||
|
||||
@@unique([economic_code, consumer_id])
|
||||
@@map("business_activities")
|
||||
@@ -78,11 +112,8 @@ model Complex {
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])
|
||||
|
||||
pos_list Pos[]
|
||||
goods Good[]
|
||||
good_categories GoodCategory[]
|
||||
permission_complexes PermissionComplex[]
|
||||
customer_individuals CustomerIndividual[]
|
||||
customer_legals CustomerLegal[]
|
||||
|
||||
@@map("complexes")
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@ model Partner {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)
|
||||
|
||||
consumers Consumer[]
|
||||
partner_accounts PartnerAccount[]
|
||||
accounts PartnerAccount[]
|
||||
consumers_individual ConsumerIndividual[]
|
||||
consumers_legal ConsumerLegal[]
|
||||
license_charge_transactions LicenseChargeTransaction[]
|
||||
account_quota_charge_transactions PartnerAccountQuotaChargeTransaction[]
|
||||
license_renew_charge_transactions LicenseRenewChargeTransaction[]
|
||||
|
||||
@@ -23,8 +23,8 @@ model Provider {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
|
||||
pos_list Pos[]
|
||||
provider_accounts ProviderAccount[]
|
||||
accounts ProviderAccount[]
|
||||
pos_list Pos[]
|
||||
|
||||
@@map("providers")
|
||||
}
|
||||
|
||||
@@ -1,51 +1,53 @@
|
||||
model Customer {
|
||||
id String @id @default(ulid())
|
||||
is_favorite Boolean? @default(false)
|
||||
id String @id @default(ulid())
|
||||
is_favorite Boolean? @default(false)
|
||||
type CustomerType
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
type CustomerType
|
||||
unknown_customer Json?
|
||||
customer_individual CustomerIndividual?
|
||||
customer_legal CustomerLegal?
|
||||
sales_invoices SalesInvoice[]
|
||||
individual CustomerIndividual?
|
||||
legal CustomerLegal?
|
||||
|
||||
sales_invoices SalesInvoice[]
|
||||
|
||||
@@map("customers")
|
||||
}
|
||||
|
||||
model CustomerIndividual {
|
||||
first_name String @db.VarChar(255)
|
||||
last_name String @db.VarChar(255)
|
||||
national_id String @db.Char(10)
|
||||
first_name String @db.VarChar(255)
|
||||
last_name String @db.VarChar(255)
|
||||
national_id String @db.Char(10)
|
||||
mobile_number String @db.Char(15)
|
||||
|
||||
postal_code String @db.Char(10)
|
||||
economic_code String? @db.Char(10)
|
||||
|
||||
customer_id String @id
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
complex_id String
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: id)
|
||||
|
||||
@@unique([complex_id, national_id])
|
||||
@@index([complex_id])
|
||||
@@unique([business_activity_id, national_id])
|
||||
@@index([business_activity_id])
|
||||
@@map("customer_individuals")
|
||||
}
|
||||
|
||||
model CustomerLegal {
|
||||
company_name String @db.VarChar(255)
|
||||
economic_code String @db.Char(10)
|
||||
registration_number String @db.Char(20)
|
||||
postal_code String @db.Char(10)
|
||||
company_name String @db.VarChar(255)
|
||||
economic_code String @db.Char(10)
|
||||
registration_number String? @db.Char(20)
|
||||
postal_code String @db.Char(10)
|
||||
|
||||
customer_id String @id
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
complex_id String
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: id)
|
||||
|
||||
@@unique([complex_id, registration_number])
|
||||
@@index([complex_id])
|
||||
@@unique([business_activity_id, economic_code])
|
||||
@@index([business_activity_id])
|
||||
@@map("customer_legal")
|
||||
}
|
||||
|
||||
@@ -150,3 +150,8 @@ enum ApplicationPublisher {
|
||||
CAFE_BAZAR
|
||||
MAYKET
|
||||
}
|
||||
|
||||
enum ConsumerType {
|
||||
INDIVIDUAL
|
||||
LEGAL
|
||||
}
|
||||
|
||||
@@ -15,11 +15,12 @@ model Good {
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
complex_id String?
|
||||
category_id String?
|
||||
category GoodCategory? @relation(fields: [category_id], references: [id])
|
||||
|
||||
business_activity_id String?
|
||||
business_activity BusinessActivity? @relation(fields: [business_activity_id], references: [id])
|
||||
|
||||
category GoodCategory? @relation(fields: [category_id], references: [id])
|
||||
complex Complex? @relation(fields: [complex_id], references: [id])
|
||||
sales_invoice_items SalesInvoiceItem[]
|
||||
|
||||
@@index([category_id])
|
||||
|
||||
@@ -5,18 +5,21 @@ model SalesInvoice {
|
||||
notes String? @db.Text
|
||||
unknown_customer Json? @db.Json
|
||||
invoice_date DateTime? @default(now()) @db.Timestamp(0)
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
|
||||
customer_id String?
|
||||
account_id String
|
||||
pos_id String
|
||||
customer Customer? @relation(fields: [customer_id], references: [id])
|
||||
|
||||
customer Customer? @relation(fields: [customer_id], references: [id])
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
consumer_account ConsumerAccount @relation(fields: [account_id], references: [id])
|
||||
items SalesInvoiceItem[]
|
||||
payments SalesInvoicePayment[]
|
||||
account_id String
|
||||
consumer_account ConsumerAccount @relation(fields: [account_id], references: [id])
|
||||
|
||||
pos_id String
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
|
||||
items SalesInvoiceItem[]
|
||||
payments SalesInvoicePayment[]
|
||||
|
||||
@@map("sales_invoices")
|
||||
}
|
||||
|
||||
+19
-14
@@ -1,6 +1,6 @@
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { generateTrackingCode } from '@/common/utils/tracking-code-generator.util'
|
||||
import { GoodPricingModel, UnitType } from '@/generated/prisma/enums'
|
||||
import { ConsumerType, GoodPricingModel, UnitType } from '@/generated/prisma/enums'
|
||||
import { GoodCreateInput, GoodCreateManyInput } from '@/generated/prisma/models'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
|
||||
@@ -16,7 +16,7 @@ async function main() {
|
||||
last_name: 'حسنی',
|
||||
national_code: '0016022289',
|
||||
mobile_number: '09120258156',
|
||||
adminAccounts: {
|
||||
accounts: {
|
||||
create: {
|
||||
account: {
|
||||
create: {
|
||||
@@ -250,7 +250,7 @@ async function main() {
|
||||
name: 'تیس',
|
||||
code: 'TIS',
|
||||
status: 'ACTIVE',
|
||||
partner_accounts: {
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
@@ -343,11 +343,21 @@ async function main() {
|
||||
},
|
||||
consumer: {
|
||||
create: {
|
||||
first_name: 'محمد',
|
||||
last_name: 'زرگر',
|
||||
mobile_number: '09120258155',
|
||||
national_code: '1234567890',
|
||||
consumer_accounts: {
|
||||
type: ConsumerType.INDIVIDUAL,
|
||||
individual: {
|
||||
create: {
|
||||
first_name: 'محمد',
|
||||
last_name: 'زرگر',
|
||||
mobile_number: '09120258155',
|
||||
national_code: '1234567890',
|
||||
partner: {
|
||||
connect: {
|
||||
id: partner.id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
@@ -360,11 +370,6 @@ async function main() {
|
||||
},
|
||||
},
|
||||
},
|
||||
partner: {
|
||||
connect: {
|
||||
id: partner.id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
guild: {
|
||||
@@ -416,7 +421,7 @@ async function main() {
|
||||
name: 'توسن',
|
||||
code: 'Tosan',
|
||||
status: 'ACTIVE',
|
||||
provider_accounts: {
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
|
||||
Reference in New Issue
Block a user