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:
@@ -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`);
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -381,7 +381,6 @@ async function main() {
|
||||
create: {
|
||||
name: 'لاین ۱',
|
||||
pos_type: POSType.WEB,
|
||||
serial: '12312312',
|
||||
status: 'ACTIVE',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -55,9 +55,6 @@ export class PosGuard {
|
||||
expires_at: true,
|
||||
},
|
||||
},
|
||||
consumer: {
|
||||
select: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ export const select: PosSelect = {
|
||||
id: true,
|
||||
name: true,
|
||||
model: true,
|
||||
serial: true,
|
||||
serial_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
pos_type: true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3146,8 +3146,8 @@ export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeo
|
||||
export const PosScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
serial: 'serial',
|
||||
model: 'model',
|
||||
serial_number: 'serial_number',
|
||||
status: 'status',
|
||||
pos_type: 'pos_type',
|
||||
created_at: 'created_at',
|
||||
@@ -3670,8 +3670,8 @@ export type ComplexOrderByRelevanceFieldEnum = (typeof ComplexOrderByRelevanceFi
|
||||
export const PosOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
serial: 'serial',
|
||||
model: 'model',
|
||||
serial_number: 'serial_number',
|
||||
complex_id: 'complex_id',
|
||||
device_id: 'device_id',
|
||||
provider_id: 'provider_id'
|
||||
|
||||
@@ -199,8 +199,8 @@ export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeo
|
||||
export const PosScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
serial: 'serial',
|
||||
model: 'model',
|
||||
serial_number: 'serial_number',
|
||||
status: 'status',
|
||||
pos_type: 'pos_type',
|
||||
created_at: 'created_at',
|
||||
@@ -723,8 +723,8 @@ export type ComplexOrderByRelevanceFieldEnum = (typeof ComplexOrderByRelevanceFi
|
||||
export const PosOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
serial: 'serial',
|
||||
model: 'model',
|
||||
serial_number: 'serial_number',
|
||||
complex_id: 'complex_id',
|
||||
device_id: 'device_id',
|
||||
provider_id: 'provider_id'
|
||||
|
||||
@@ -218,7 +218,7 @@ export type LicenseWhereInput = {
|
||||
charge_transaction_id?: Prisma.StringFilter<"License"> | string
|
||||
charge_transaction?: Prisma.XOR<Prisma.LicenseChargeTransactionScalarRelationFilter, Prisma.LicenseChargeTransactionWhereInput>
|
||||
activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationListRelationFilter
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationListRelationFilter
|
||||
}
|
||||
|
||||
export type LicenseOrderByWithRelationInput = {
|
||||
@@ -229,7 +229,7 @@ export type LicenseOrderByWithRelationInput = {
|
||||
charge_transaction_id?: Prisma.SortOrder
|
||||
charge_transaction?: Prisma.LicenseChargeTransactionOrderByWithRelationInput
|
||||
activation?: Prisma.LicenseActivationOrderByWithRelationInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationOrderByRelationAggregateInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.LicenseOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ export type LicenseWhereUniqueInput = Prisma.AtLeast<{
|
||||
charge_transaction_id?: Prisma.StringFilter<"License"> | string
|
||||
charge_transaction?: Prisma.XOR<Prisma.LicenseChargeTransactionScalarRelationFilter, Prisma.LicenseChargeTransactionWhereInput>
|
||||
activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationListRelationFilter
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type LicenseOrderByWithAggregationInput = {
|
||||
@@ -278,7 +278,7 @@ export type LicenseCreateInput = {
|
||||
updated_at?: Date | string
|
||||
charge_transaction: Prisma.LicenseChargeTransactionCreateNestedOneWithoutLicensesInput
|
||||
activation?: Prisma.LicenseActivationCreateNestedOneWithoutLicenseInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateInput = {
|
||||
@@ -288,7 +288,7 @@ export type LicenseUncheckedCreateInput = {
|
||||
updated_at?: Date | string
|
||||
charge_transaction_id: string
|
||||
activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutLicenseInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUpdateInput = {
|
||||
@@ -298,7 +298,7 @@ export type LicenseUpdateInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
charge_transaction?: Prisma.LicenseChargeTransactionUpdateOneRequiredWithoutLicensesNestedInput
|
||||
activation?: Prisma.LicenseActivationUpdateOneWithoutLicenseNestedInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateInput = {
|
||||
@@ -308,7 +308,7 @@ export type LicenseUncheckedUpdateInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
charge_transaction_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutLicenseNestedInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseCreateManyInput = {
|
||||
@@ -456,20 +456,20 @@ export type LicenseUncheckedUpdateManyWithoutCharge_transactionNestedInput = {
|
||||
deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type LicenseCreateNestedOneWithoutAllocationsInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutAllocationsInput, Prisma.LicenseUncheckedCreateWithoutAllocationsInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutAllocationsInput
|
||||
export type LicenseCreateNestedOneWithoutAccount_allocationsInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedCreateWithoutAccount_allocationsInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutAccount_allocationsInput
|
||||
connect?: Prisma.LicenseWhereUniqueInput
|
||||
}
|
||||
|
||||
export type LicenseUpdateOneWithoutAllocationsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutAllocationsInput, Prisma.LicenseUncheckedCreateWithoutAllocationsInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutAllocationsInput
|
||||
upsert?: Prisma.LicenseUpsertWithoutAllocationsInput
|
||||
export type LicenseUpdateOneWithoutAccount_allocationsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedCreateWithoutAccount_allocationsInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutAccount_allocationsInput
|
||||
upsert?: Prisma.LicenseUpsertWithoutAccount_allocationsInput
|
||||
disconnect?: Prisma.LicenseWhereInput | boolean
|
||||
delete?: Prisma.LicenseWhereInput | boolean
|
||||
connect?: Prisma.LicenseWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.LicenseUpdateToOneWithWhereWithoutAllocationsInput, Prisma.LicenseUpdateWithoutAllocationsInput>, Prisma.LicenseUncheckedUpdateWithoutAllocationsInput>
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.LicenseUpdateToOneWithWhereWithoutAccount_allocationsInput, Prisma.LicenseUpdateWithoutAccount_allocationsInput>, Prisma.LicenseUncheckedUpdateWithoutAccount_allocationsInput>
|
||||
}
|
||||
|
||||
export type LicenseCreateWithoutActivationInput = {
|
||||
@@ -478,7 +478,7 @@ export type LicenseCreateWithoutActivationInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
charge_transaction: Prisma.LicenseChargeTransactionCreateNestedOneWithoutLicensesInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateWithoutActivationInput = {
|
||||
@@ -487,7 +487,7 @@ export type LicenseUncheckedCreateWithoutActivationInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
charge_transaction_id: string
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseCreateOrConnectWithoutActivationInput = {
|
||||
@@ -512,7 +512,7 @@ export type LicenseUpdateWithoutActivationInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
charge_transaction?: Prisma.LicenseChargeTransactionUpdateOneRequiredWithoutLicensesNestedInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateWithoutActivationInput = {
|
||||
@@ -521,7 +521,7 @@ export type LicenseUncheckedUpdateWithoutActivationInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
charge_transaction_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseCreateWithoutCharge_transactionInput = {
|
||||
@@ -530,7 +530,7 @@ export type LicenseCreateWithoutCharge_transactionInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
activation?: Prisma.LicenseActivationCreateNestedOneWithoutLicenseInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateWithoutCharge_transactionInput = {
|
||||
@@ -539,7 +539,7 @@ export type LicenseUncheckedCreateWithoutCharge_transactionInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutLicenseInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseCreateOrConnectWithoutCharge_transactionInput = {
|
||||
@@ -579,7 +579,7 @@ export type LicenseScalarWhereInput = {
|
||||
charge_transaction_id?: Prisma.StringFilter<"License"> | string
|
||||
}
|
||||
|
||||
export type LicenseCreateWithoutAllocationsInput = {
|
||||
export type LicenseCreateWithoutAccount_allocationsInput = {
|
||||
id?: string
|
||||
accounts_limit?: number
|
||||
created_at?: Date | string
|
||||
@@ -588,7 +588,7 @@ export type LicenseCreateWithoutAllocationsInput = {
|
||||
activation?: Prisma.LicenseActivationCreateNestedOneWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateWithoutAllocationsInput = {
|
||||
export type LicenseUncheckedCreateWithoutAccount_allocationsInput = {
|
||||
id?: string
|
||||
accounts_limit?: number
|
||||
created_at?: Date | string
|
||||
@@ -597,23 +597,23 @@ export type LicenseUncheckedCreateWithoutAllocationsInput = {
|
||||
activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseCreateOrConnectWithoutAllocationsInput = {
|
||||
export type LicenseCreateOrConnectWithoutAccount_allocationsInput = {
|
||||
where: Prisma.LicenseWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutAllocationsInput, Prisma.LicenseUncheckedCreateWithoutAllocationsInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedCreateWithoutAccount_allocationsInput>
|
||||
}
|
||||
|
||||
export type LicenseUpsertWithoutAllocationsInput = {
|
||||
update: Prisma.XOR<Prisma.LicenseUpdateWithoutAllocationsInput, Prisma.LicenseUncheckedUpdateWithoutAllocationsInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutAllocationsInput, Prisma.LicenseUncheckedCreateWithoutAllocationsInput>
|
||||
export type LicenseUpsertWithoutAccount_allocationsInput = {
|
||||
update: Prisma.XOR<Prisma.LicenseUpdateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedUpdateWithoutAccount_allocationsInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedCreateWithoutAccount_allocationsInput>
|
||||
where?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
export type LicenseUpdateToOneWithWhereWithoutAllocationsInput = {
|
||||
export type LicenseUpdateToOneWithWhereWithoutAccount_allocationsInput = {
|
||||
where?: Prisma.LicenseWhereInput
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateWithoutAllocationsInput, Prisma.LicenseUncheckedUpdateWithoutAllocationsInput>
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateWithoutAccount_allocationsInput, Prisma.LicenseUncheckedUpdateWithoutAccount_allocationsInput>
|
||||
}
|
||||
|
||||
export type LicenseUpdateWithoutAllocationsInput = {
|
||||
export type LicenseUpdateWithoutAccount_allocationsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
accounts_limit?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -622,7 +622,7 @@ export type LicenseUpdateWithoutAllocationsInput = {
|
||||
activation?: Prisma.LicenseActivationUpdateOneWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateWithoutAllocationsInput = {
|
||||
export type LicenseUncheckedUpdateWithoutAccount_allocationsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
accounts_limit?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -644,7 +644,7 @@ export type LicenseUpdateWithoutCharge_transactionInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
activation?: Prisma.LicenseActivationUpdateOneWithoutLicenseNestedInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateWithoutCharge_transactionInput = {
|
||||
@@ -653,7 +653,7 @@ export type LicenseUncheckedUpdateWithoutCharge_transactionInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutLicenseNestedInput
|
||||
allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
account_allocations?: Prisma.PartnerAccountQuotaAllocationUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateManyWithoutCharge_transactionInput = {
|
||||
@@ -669,11 +669,11 @@ export type LicenseUncheckedUpdateManyWithoutCharge_transactionInput = {
|
||||
*/
|
||||
|
||||
export type LicenseCountOutputType = {
|
||||
allocations: number
|
||||
account_allocations: number
|
||||
}
|
||||
|
||||
export type LicenseCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
allocations?: boolean | LicenseCountOutputTypeCountAllocationsArgs
|
||||
account_allocations?: boolean | LicenseCountOutputTypeCountAccount_allocationsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -689,7 +689,7 @@ export type LicenseCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Exte
|
||||
/**
|
||||
* LicenseCountOutputType without action
|
||||
*/
|
||||
export type LicenseCountOutputTypeCountAllocationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
export type LicenseCountOutputTypeCountAccount_allocationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.PartnerAccountQuotaAllocationWhereInput
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ export type LicenseSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
charge_transaction_id?: boolean
|
||||
charge_transaction?: boolean | Prisma.LicenseChargeTransactionDefaultArgs<ExtArgs>
|
||||
activation?: boolean | Prisma.License$activationArgs<ExtArgs>
|
||||
allocations?: boolean | Prisma.License$allocationsArgs<ExtArgs>
|
||||
account_allocations?: boolean | Prisma.License$account_allocationsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.LicenseCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["license"]>
|
||||
|
||||
@@ -720,7 +720,7 @@ export type LicenseOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
export type LicenseInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
charge_transaction?: boolean | Prisma.LicenseChargeTransactionDefaultArgs<ExtArgs>
|
||||
activation?: boolean | Prisma.License$activationArgs<ExtArgs>
|
||||
allocations?: boolean | Prisma.License$allocationsArgs<ExtArgs>
|
||||
account_allocations?: boolean | Prisma.License$account_allocationsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.LicenseCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ export type $LicensePayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
objects: {
|
||||
charge_transaction: Prisma.$LicenseChargeTransactionPayload<ExtArgs>
|
||||
activation: Prisma.$LicenseActivationPayload<ExtArgs> | null
|
||||
allocations: Prisma.$PartnerAccountQuotaAllocationPayload<ExtArgs>[]
|
||||
account_allocations: Prisma.$PartnerAccountQuotaAllocationPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1079,7 +1079,7 @@ export interface Prisma__LicenseClient<T, Null = never, ExtArgs extends runtime.
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
charge_transaction<T extends Prisma.LicenseChargeTransactionDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.LicenseChargeTransactionDefaultArgs<ExtArgs>>): Prisma.Prisma__LicenseChargeTransactionClient<runtime.Types.Result.GetResult<Prisma.$LicenseChargeTransactionPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
activation<T extends Prisma.License$activationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.License$activationArgs<ExtArgs>>): Prisma.Prisma__LicenseActivationClient<runtime.Types.Result.GetResult<Prisma.$LicenseActivationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
allocations<T extends Prisma.License$allocationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.License$allocationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PartnerAccountQuotaAllocationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
account_allocations<T extends Prisma.License$account_allocationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.License$account_allocationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PartnerAccountQuotaAllocationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1481,9 +1481,9 @@ export type License$activationArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
}
|
||||
|
||||
/**
|
||||
* License.allocations
|
||||
* License.account_allocations
|
||||
*/
|
||||
export type License$allocationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
export type License$account_allocationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the PartnerAccountQuotaAllocation
|
||||
*/
|
||||
|
||||
@@ -237,7 +237,7 @@ export type PartnerAccountQuotaAllocationCreateInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
charge_transaction: Prisma.PartnerAccountQuotaChargeTransactionCreateNestedOneWithoutAllocationsInput
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutAllocationsInput
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutAccount_allocationsInput
|
||||
}
|
||||
|
||||
export type PartnerAccountQuotaAllocationUncheckedCreateInput = {
|
||||
@@ -253,7 +253,7 @@ export type PartnerAccountQuotaAllocationUpdateInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
charge_transaction?: Prisma.PartnerAccountQuotaChargeTransactionUpdateOneRequiredWithoutAllocationsNestedInput
|
||||
license?: Prisma.LicenseUpdateOneWithoutAllocationsNestedInput
|
||||
license?: Prisma.LicenseUpdateOneWithoutAccount_allocationsNestedInput
|
||||
}
|
||||
|
||||
export type PartnerAccountQuotaAllocationUncheckedUpdateInput = {
|
||||
@@ -465,7 +465,7 @@ export type PartnerAccountQuotaAllocationCreateWithoutCharge_transactionInput =
|
||||
id?: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutAllocationsInput
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutAccount_allocationsInput
|
||||
}
|
||||
|
||||
export type PartnerAccountQuotaAllocationUncheckedCreateWithoutCharge_transactionInput = {
|
||||
@@ -540,7 +540,7 @@ export type PartnerAccountQuotaAllocationUpdateWithoutCharge_transactionInput =
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
license?: Prisma.LicenseUpdateOneWithoutAllocationsNestedInput
|
||||
license?: Prisma.LicenseUpdateOneWithoutAccount_allocationsNestedInput
|
||||
}
|
||||
|
||||
export type PartnerAccountQuotaAllocationUncheckedUpdateWithoutCharge_transactionInput = {
|
||||
|
||||
@@ -27,8 +27,8 @@ export type AggregatePos = {
|
||||
export type PosMinAggregateOutputType = {
|
||||
id: string | null
|
||||
name: string | null
|
||||
serial: string | null
|
||||
model: string | null
|
||||
serial_number: string | null
|
||||
status: $Enums.POSStatus | null
|
||||
pos_type: $Enums.POSType | null
|
||||
created_at: Date | null
|
||||
@@ -41,8 +41,8 @@ export type PosMinAggregateOutputType = {
|
||||
export type PosMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
name: string | null
|
||||
serial: string | null
|
||||
model: string | null
|
||||
serial_number: string | null
|
||||
status: $Enums.POSStatus | null
|
||||
pos_type: $Enums.POSType | null
|
||||
created_at: Date | null
|
||||
@@ -55,8 +55,8 @@ export type PosMaxAggregateOutputType = {
|
||||
export type PosCountAggregateOutputType = {
|
||||
id: number
|
||||
name: number
|
||||
serial: number
|
||||
model: number
|
||||
serial_number: number
|
||||
status: number
|
||||
pos_type: number
|
||||
created_at: number
|
||||
@@ -71,8 +71,8 @@ export type PosCountAggregateOutputType = {
|
||||
export type PosMinAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
serial?: true
|
||||
model?: true
|
||||
serial_number?: true
|
||||
status?: true
|
||||
pos_type?: true
|
||||
created_at?: true
|
||||
@@ -85,8 +85,8 @@ export type PosMinAggregateInputType = {
|
||||
export type PosMaxAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
serial?: true
|
||||
model?: true
|
||||
serial_number?: true
|
||||
status?: true
|
||||
pos_type?: true
|
||||
created_at?: true
|
||||
@@ -99,8 +99,8 @@ export type PosMaxAggregateInputType = {
|
||||
export type PosCountAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
serial?: true
|
||||
model?: true
|
||||
serial_number?: true
|
||||
status?: true
|
||||
pos_type?: true
|
||||
created_at?: true
|
||||
@@ -186,8 +186,8 @@ export type PosGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
export type PosGroupByOutputType = {
|
||||
id: string
|
||||
name: string
|
||||
serial: string
|
||||
model: string | null
|
||||
serial_number: string | null
|
||||
status: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at: Date
|
||||
@@ -221,8 +221,8 @@ export type PosWhereInput = {
|
||||
NOT?: Prisma.PosWhereInput | Prisma.PosWhereInput[]
|
||||
id?: Prisma.StringFilter<"Pos"> | string
|
||||
name?: Prisma.StringFilter<"Pos"> | string
|
||||
serial?: Prisma.StringFilter<"Pos"> | string
|
||||
model?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
serial_number?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
status?: Prisma.EnumPOSStatusFilter<"Pos"> | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFilter<"Pos"> | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFilter<"Pos"> | Date | string
|
||||
@@ -240,8 +240,8 @@ export type PosWhereInput = {
|
||||
export type PosOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
serial?: Prisma.SortOrder
|
||||
model?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
serial_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
pos_type?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -259,7 +259,7 @@ export type PosOrderByWithRelationInput = {
|
||||
|
||||
export type PosWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: string
|
||||
serial?: string
|
||||
serial_number?: string
|
||||
AND?: Prisma.PosWhereInput | Prisma.PosWhereInput[]
|
||||
OR?: Prisma.PosWhereInput[]
|
||||
NOT?: Prisma.PosWhereInput | Prisma.PosWhereInput[]
|
||||
@@ -277,13 +277,13 @@ export type PosWhereUniqueInput = Prisma.AtLeast<{
|
||||
provider?: Prisma.XOR<Prisma.ProviderNullableScalarRelationFilter, Prisma.ProviderWhereInput> | null
|
||||
permission_pos?: Prisma.PermissionPosListRelationFilter
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}, "id" | "serial">
|
||||
}, "id" | "serial_number">
|
||||
|
||||
export type PosOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
serial?: Prisma.SortOrder
|
||||
model?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
serial_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
pos_type?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -302,8 +302,8 @@ export type PosScalarWhereWithAggregatesInput = {
|
||||
NOT?: Prisma.PosScalarWhereWithAggregatesInput | Prisma.PosScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"Pos"> | string
|
||||
name?: Prisma.StringWithAggregatesFilter<"Pos"> | string
|
||||
serial?: Prisma.StringWithAggregatesFilter<"Pos"> | string
|
||||
model?: Prisma.StringNullableWithAggregatesFilter<"Pos"> | string | null
|
||||
serial_number?: Prisma.StringNullableWithAggregatesFilter<"Pos"> | string | null
|
||||
status?: Prisma.EnumPOSStatusWithAggregatesFilter<"Pos"> | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeWithAggregatesFilter<"Pos"> | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"Pos"> | Date | string
|
||||
@@ -316,8 +316,8 @@ export type PosScalarWhereWithAggregatesInput = {
|
||||
export type PosCreateInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -332,8 +332,8 @@ export type PosCreateInput = {
|
||||
export type PosUncheckedCreateInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -348,8 +348,8 @@ export type PosUncheckedCreateInput = {
|
||||
export type PosUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -364,8 +364,8 @@ export type PosUpdateInput = {
|
||||
export type PosUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -380,8 +380,8 @@ export type PosUncheckedUpdateInput = {
|
||||
export type PosCreateManyInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -394,8 +394,8 @@ export type PosCreateManyInput = {
|
||||
export type PosUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -405,8 +405,8 @@ export type PosUpdateManyMutationInput = {
|
||||
export type PosUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -435,8 +435,8 @@ export type PosOrderByRelevanceInput = {
|
||||
export type PosCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
serial?: Prisma.SortOrder
|
||||
model?: Prisma.SortOrder
|
||||
serial_number?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
pos_type?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -449,8 +449,8 @@ export type PosCountOrderByAggregateInput = {
|
||||
export type PosMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
serial?: Prisma.SortOrder
|
||||
model?: Prisma.SortOrder
|
||||
serial_number?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
pos_type?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -463,8 +463,8 @@ export type PosMaxOrderByAggregateInput = {
|
||||
export type PosMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
serial?: Prisma.SortOrder
|
||||
model?: Prisma.SortOrder
|
||||
serial_number?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
pos_type?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -644,8 +644,8 @@ export type PosUpdateOneRequiredWithoutSales_invoicesNestedInput = {
|
||||
export type PosCreateWithoutComplexInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -659,8 +659,8 @@ export type PosCreateWithoutComplexInput = {
|
||||
export type PosUncheckedCreateWithoutComplexInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -703,8 +703,8 @@ export type PosScalarWhereInput = {
|
||||
NOT?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"Pos"> | string
|
||||
name?: Prisma.StringFilter<"Pos"> | string
|
||||
serial?: Prisma.StringFilter<"Pos"> | string
|
||||
model?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
serial_number?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
status?: Prisma.EnumPOSStatusFilter<"Pos"> | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFilter<"Pos"> | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFilter<"Pos"> | Date | string
|
||||
@@ -717,8 +717,8 @@ export type PosScalarWhereInput = {
|
||||
export type PosCreateWithoutDeviceInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -732,8 +732,8 @@ export type PosCreateWithoutDeviceInput = {
|
||||
export type PosUncheckedCreateWithoutDeviceInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -773,8 +773,8 @@ export type PosUpdateManyWithWhereWithoutDeviceInput = {
|
||||
export type PosCreateWithoutPermission_posInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -788,8 +788,8 @@ export type PosCreateWithoutPermission_posInput = {
|
||||
export type PosUncheckedCreateWithoutPermission_posInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -819,8 +819,8 @@ export type PosUpdateToOneWithWhereWithoutPermission_posInput = {
|
||||
export type PosUpdateWithoutPermission_posInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -834,8 +834,8 @@ export type PosUpdateWithoutPermission_posInput = {
|
||||
export type PosUncheckedUpdateWithoutPermission_posInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -849,8 +849,8 @@ export type PosUncheckedUpdateWithoutPermission_posInput = {
|
||||
export type PosCreateWithoutProviderInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -864,8 +864,8 @@ export type PosCreateWithoutProviderInput = {
|
||||
export type PosUncheckedCreateWithoutProviderInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -905,8 +905,8 @@ export type PosUpdateManyWithWhereWithoutProviderInput = {
|
||||
export type PosCreateWithoutSales_invoicesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -920,8 +920,8 @@ export type PosCreateWithoutSales_invoicesInput = {
|
||||
export type PosUncheckedCreateWithoutSales_invoicesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -951,8 +951,8 @@ export type PosUpdateToOneWithWhereWithoutSales_invoicesInput = {
|
||||
export type PosUpdateWithoutSales_invoicesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -966,8 +966,8 @@ export type PosUpdateWithoutSales_invoicesInput = {
|
||||
export type PosUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -981,8 +981,8 @@ export type PosUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
export type PosCreateManyComplexInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -994,8 +994,8 @@ export type PosCreateManyComplexInput = {
|
||||
export type PosUpdateWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1009,8 +1009,8 @@ export type PosUpdateWithoutComplexInput = {
|
||||
export type PosUncheckedUpdateWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1024,8 +1024,8 @@ export type PosUncheckedUpdateWithoutComplexInput = {
|
||||
export type PosUncheckedUpdateManyWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1037,8 +1037,8 @@ export type PosUncheckedUpdateManyWithoutComplexInput = {
|
||||
export type PosCreateManyDeviceInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -1050,8 +1050,8 @@ export type PosCreateManyDeviceInput = {
|
||||
export type PosUpdateWithoutDeviceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1065,8 +1065,8 @@ export type PosUpdateWithoutDeviceInput = {
|
||||
export type PosUncheckedUpdateWithoutDeviceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1080,8 +1080,8 @@ export type PosUncheckedUpdateWithoutDeviceInput = {
|
||||
export type PosUncheckedUpdateManyWithoutDeviceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1093,8 +1093,8 @@ export type PosUncheckedUpdateManyWithoutDeviceInput = {
|
||||
export type PosCreateManyProviderInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
serial_number?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
@@ -1106,8 +1106,8 @@ export type PosCreateManyProviderInput = {
|
||||
export type PosUpdateWithoutProviderInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1121,8 +1121,8 @@ export type PosUpdateWithoutProviderInput = {
|
||||
export type PosUncheckedUpdateWithoutProviderInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1136,8 +1136,8 @@ export type PosUncheckedUpdateWithoutProviderInput = {
|
||||
export type PosUncheckedUpdateManyWithoutProviderInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
serial_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1189,8 +1189,8 @@ export type PosCountOutputTypeCountSales_invoicesArgs<ExtArgs extends runtime.Ty
|
||||
export type PosSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
serial?: boolean
|
||||
model?: boolean
|
||||
serial_number?: boolean
|
||||
status?: boolean
|
||||
pos_type?: boolean
|
||||
created_at?: boolean
|
||||
@@ -1211,8 +1211,8 @@ export type PosSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = ru
|
||||
export type PosSelectScalar = {
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
serial?: boolean
|
||||
model?: boolean
|
||||
serial_number?: boolean
|
||||
status?: boolean
|
||||
pos_type?: boolean
|
||||
created_at?: boolean
|
||||
@@ -1222,7 +1222,7 @@ export type PosSelectScalar = {
|
||||
provider_id?: boolean
|
||||
}
|
||||
|
||||
export type PosOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "serial" | "model" | "status" | "pos_type" | "created_at" | "updated_at" | "complex_id" | "device_id" | "provider_id", ExtArgs["result"]["pos"]>
|
||||
export type PosOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "model" | "serial_number" | "status" | "pos_type" | "created_at" | "updated_at" | "complex_id" | "device_id" | "provider_id", ExtArgs["result"]["pos"]>
|
||||
export type PosInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
device?: boolean | Prisma.Pos$deviceArgs<ExtArgs>
|
||||
@@ -1244,8 +1244,8 @@ export type $PosPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
name: string
|
||||
serial: string
|
||||
model: string | null
|
||||
serial_number: string | null
|
||||
status: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at: Date
|
||||
@@ -1629,8 +1629,8 @@ export interface Prisma__PosClient<T, Null = never, ExtArgs extends runtime.Type
|
||||
export interface PosFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"Pos", 'String'>
|
||||
readonly name: Prisma.FieldRef<"Pos", 'String'>
|
||||
readonly serial: Prisma.FieldRef<"Pos", 'String'>
|
||||
readonly model: Prisma.FieldRef<"Pos", 'String'>
|
||||
readonly serial_number: Prisma.FieldRef<"Pos", 'String'>
|
||||
readonly status: Prisma.FieldRef<"Pos", 'POSStatus'>
|
||||
readonly pos_type: Prisma.FieldRef<"Pos", 'POSType'>
|
||||
readonly created_at: Prisma.FieldRef<"Pos", 'DateTime'>
|
||||
|
||||
@@ -7,13 +7,13 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
export class BusinessActivityComplexesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect = {
|
||||
defaultSelect: ComplexSelect = {
|
||||
id: true,
|
||||
name: true,
|
||||
address: true,
|
||||
tax_id: true,
|
||||
branch_code: true,
|
||||
created_at: true,
|
||||
} as ComplexSelect
|
||||
}
|
||||
|
||||
async findAll(consumer_id: string, business_activity_id: string) {
|
||||
const accounts = await this.prisma.complex.findMany({
|
||||
|
||||
@@ -12,7 +12,7 @@ export class ComplexPosesService {
|
||||
id: true,
|
||||
name: true,
|
||||
model: true,
|
||||
serial: true,
|
||||
serial_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
pos_type: true,
|
||||
|
||||
-2
@@ -136,8 +136,6 @@ export class PartnerAccountChargeTransactionService {
|
||||
}
|
||||
const createdAllocations = await Promise.all(accountCreationPromises)
|
||||
|
||||
console.log(createdAllocations)
|
||||
|
||||
if (
|
||||
createdAllocations.some(
|
||||
createdAllocation => createdAllocation.activation_id === null,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
export class BusinessActivitiesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect = {
|
||||
defaultSelect: BusinessActivitySelect = {
|
||||
guild: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -18,7 +18,38 @@ export class BusinessActivitiesService {
|
||||
id: true,
|
||||
name: true,
|
||||
created_at: true,
|
||||
} as BusinessActivitySelect
|
||||
license_activation: {
|
||||
select: {
|
||||
id: true,
|
||||
starts_at: true,
|
||||
expires_at: true,
|
||||
license: {
|
||||
select: {
|
||||
accounts_limit: true,
|
||||
_count: {
|
||||
select: {
|
||||
account_allocations: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
private readonly prepareBusinessActivityResponse = (businessActivity: any) => {
|
||||
const { license_activation, ...rest } = businessActivity
|
||||
const { license, ...license_activation_rest } = license_activation
|
||||
const { accounts_limit, _count } = license
|
||||
|
||||
return {
|
||||
...rest,
|
||||
license_info: {
|
||||
...license_activation_rest,
|
||||
accounts_limit: accounts_limit + _count.account_allocations,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
async findAll(consumer_id: string) {
|
||||
const businessActivities = await this.prisma.businessActivity.findMany({
|
||||
@@ -27,7 +58,9 @@ export class BusinessActivitiesService {
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
return ResponseMapper.list(businessActivities)
|
||||
return ResponseMapper.list(
|
||||
businessActivities.map(this.prepareBusinessActivityResponse),
|
||||
)
|
||||
}
|
||||
|
||||
async findOne(consumer_id: string, id: string) {
|
||||
@@ -35,7 +68,7 @@ export class BusinessActivitiesService {
|
||||
where: { consumer_id, id },
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
return ResponseMapper.single(businessActivity)
|
||||
return ResponseMapper.single(this.prepareBusinessActivityResponse(businessActivity))
|
||||
}
|
||||
|
||||
async update(consumer_id: string, id: string, data: any) {
|
||||
@@ -44,6 +77,6 @@ export class BusinessActivitiesService {
|
||||
data,
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
return ResponseMapper.update(businessActivity)
|
||||
return ResponseMapper.update(this.prepareBusinessActivityResponse(businessActivity))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import { UpdateComplexDto } from './dto/complex.dto'
|
||||
export class BusinessActivityComplexesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect = {
|
||||
defaultSelect: ComplexSelect = {
|
||||
id: true,
|
||||
name: true,
|
||||
address: true,
|
||||
tax_id: true,
|
||||
branch_code: true,
|
||||
created_at: true,
|
||||
} as ComplexSelect
|
||||
}
|
||||
|
||||
async findAll(consumer_id: string, business_activity_id: string) {
|
||||
const accounts = await this.prisma.complex.findMany({
|
||||
|
||||
@@ -13,7 +13,7 @@ export class ComplexPosesService {
|
||||
id: true,
|
||||
name: true,
|
||||
model: true,
|
||||
serial: true,
|
||||
serial_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
pos_type: true,
|
||||
|
||||
@@ -20,6 +20,37 @@ export class BusinessActivitiesService {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
license_activation: {
|
||||
select: {
|
||||
id: true,
|
||||
starts_at: true,
|
||||
expires_at: true,
|
||||
license: {
|
||||
select: {
|
||||
accounts_limit: true,
|
||||
_count: {
|
||||
select: {
|
||||
account_allocations: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
private readonly prepareBusinessActivityResponse = (businessActivity: any) => {
|
||||
const { license_activation, ...rest } = businessActivity
|
||||
const { license, ...license_activation_rest } = license_activation
|
||||
const { accounts_limit, _count } = license
|
||||
|
||||
return {
|
||||
...rest,
|
||||
license_info: {
|
||||
...license_activation_rest,
|
||||
accounts_limit: accounts_limit + _count.account_allocations,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
async findAll(partner_id: string, consumer_id: string) {
|
||||
@@ -32,7 +63,9 @@ export class BusinessActivitiesService {
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
return ResponseMapper.list(businessActivities)
|
||||
return ResponseMapper.list(
|
||||
businessActivities.map(this.prepareBusinessActivityResponse),
|
||||
)
|
||||
}
|
||||
|
||||
async findOne(partner_id: string, consumer_id: string, id: string) {
|
||||
@@ -46,7 +79,7 @@ export class BusinessActivitiesService {
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
return ResponseMapper.single(businessActivity)
|
||||
return ResponseMapper.single(this.prepareBusinessActivityResponse(businessActivity))
|
||||
}
|
||||
|
||||
async create(consumer_id: string, data: CreateBusinessActivitiesDto) {
|
||||
|
||||
@@ -7,10 +7,6 @@ export class CreatePosDto {
|
||||
@ApiProperty({})
|
||||
name: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({})
|
||||
serial: string
|
||||
|
||||
// @IsString()
|
||||
// @IsOptional()
|
||||
// @ApiProperty({ required: false })
|
||||
@@ -25,6 +21,11 @@ export class CreatePosDto {
|
||||
@ApiProperty({})
|
||||
device_id: string
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({})
|
||||
serial: string
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty()
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { CreatePosDto, UpdatePosDto } from './dto/pos.dto'
|
||||
import { ComplexPosesService } from './poses.service'
|
||||
|
||||
@ApiTags('AdminComplexPoses')
|
||||
@Controller('admin/business_activities/:businessActivityId/complexes/:complexId/poses')
|
||||
@Controller('partner/business_activities/:businessActivityId/complexes/:complexId/poses')
|
||||
export class ComplexPosesController {
|
||||
constructor(private readonly service: ComplexPosesService) {}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class ComplexPosesService {
|
||||
id: true,
|
||||
name: true,
|
||||
model: true,
|
||||
serial: true,
|
||||
serial_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
pos_type: true,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { IsString } from 'class-validator'
|
||||
|
||||
export class UpdatePartnerProfileDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
name: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
code: string
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ConsumerInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { PartnerInfo } from '@/common/decorators/partnerInfo.decorator'
|
||||
import { Controller, Get, Patch } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { UpdatePartnerProfileDto } from './dto/partner.dto'
|
||||
import { PartnerService } from './partners.service'
|
||||
|
||||
@ApiTags('Partner')
|
||||
@@ -9,7 +10,12 @@ export class PartnerController {
|
||||
constructor(private service: PartnerService) {}
|
||||
|
||||
@Get('')
|
||||
async findOne(@ConsumerInfo('id') consumerId: string) {
|
||||
return this.service.getInfo(consumerId)
|
||||
async findOne(@PartnerInfo('id') partnerId: string) {
|
||||
return this.service.getInfo(partnerId)
|
||||
}
|
||||
|
||||
@Patch('profile')
|
||||
async update(@PartnerInfo('id') partnerId: string, data: UpdatePartnerProfileDto) {
|
||||
return this.service.updateInfo(partnerId, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,52 @@
|
||||
import { ResponseMapper } from '@/common/response/response-mapper'
|
||||
import { PartnerSelect } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { UpdatePartnerProfileDto } from './dto/partner.dto'
|
||||
|
||||
@Injectable()
|
||||
export class PartnerService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly defaultSelect: PartnerSelect = {
|
||||
id: true,
|
||||
name: true,
|
||||
status: true,
|
||||
account_quota_charge_transactions: {
|
||||
select: {
|
||||
_count: {
|
||||
select: {
|
||||
allocations: {
|
||||
where: {
|
||||
license_id: undefined,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
async getInfo(partner_id: string) {
|
||||
const partner = await this.prisma.partner.findUniqueOrThrow({
|
||||
where: {
|
||||
id: partner_id,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
status: true,
|
||||
account_quota_charge_transactions: {
|
||||
select: {
|
||||
_count: {
|
||||
select: {
|
||||
allocations: {
|
||||
where: {
|
||||
license_id: undefined,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
|
||||
return ResponseMapper.single(partner)
|
||||
}
|
||||
|
||||
async updateInfo(partner_id: string, data: UpdatePartnerProfileDto) {
|
||||
const updatedPartner = await this.prisma.partner.update({
|
||||
where: {
|
||||
id: partner_id,
|
||||
},
|
||||
data,
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
|
||||
return ResponseMapper.single(updatedPartner)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user