feat: complete scheduled publishing, security remediation and DEV_TICKETS implementation
This commit is contained in:
1 parent
d6d4158cbe
commit
efb3c473c4
35 files changed
+685
-185
No files matched your search
@@ -30,64 +30,6 @@ export class UsersService {
|
||||
) {}
|
||||
|
||||
async findById(id: string) {
|
||||
if (id === '12345678-1234-1234-1234-123456789012') {
|
||||
const dbUser = await this.prisma.user.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
pets: {
|
||||
include: {
|
||||
medicalConditions: true,
|
||||
reminders: {
|
||||
include: {
|
||||
completions: true,
|
||||
},
|
||||
},
|
||||
healthLogs: true,
|
||||
},
|
||||
},
|
||||
orders: {
|
||||
orderBy: { createdAt: 'desc' },
|
||||
include: {
|
||||
orderItems: {
|
||||
include: { product: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
addresses: true,
|
||||
walletTransactions: {
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 50,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (dbUser) {
|
||||
const { password, ...safeUser } = dbUser;
|
||||
return {
|
||||
...safeUser,
|
||||
hasPassword: !!password,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
id: '12345678-1234-1234-1234-123456789012',
|
||||
firstName: 'مدیر',
|
||||
lastName: 'سیستم',
|
||||
email: process.env.ADMIN_EMAIL || 'admin@canina.ir',
|
||||
mobile: '09120000000',
|
||||
role: 'Admin',
|
||||
walletBalance: new Prisma.Decimal(0),
|
||||
charityDonationTotal: new Prisma.Decimal(0),
|
||||
pets: [],
|
||||
orders: [],
|
||||
addresses: [],
|
||||
walletTransactions: [],
|
||||
hasPassword: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
}
|
||||
|
||||
const user = await this.prisma.user.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
|
||||
Reference in new issue
Block a user