fix tests and docker-compose
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { PrismaClient } from '@rentaldrivego/database'
|
import { PrismaClient } from '@rentaldrivego/database/client'
|
||||||
|
|
||||||
const globalForPrisma = global as unknown as { prisma: PrismaClient }
|
const globalForPrisma = global as unknown as { prisma: PrismaClient }
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ services:
|
|||||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3001/', (r) => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))\""]
|
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3001/dashboard', (r) => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))\""]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
@@ -152,7 +152,7 @@ services:
|
|||||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3002/', (r) => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))\""]
|
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3002/admin', (r) => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))\""]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
@@ -22,11 +22,15 @@
|
|||||||
"@types/bcryptjs": "^2.4.6"
|
"@types/bcryptjs": "^2.4.6"
|
||||||
},
|
},
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.d.ts",
|
||||||
"default": "./src/index.js"
|
"default": "./src/index.js"
|
||||||
|
},
|
||||||
|
"./client": {
|
||||||
|
"types": "./src/client.d.ts",
|
||||||
|
"default": "./src/client.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
export { PrismaClient } from '../generated'
|
||||||
|
export declare function ensureDatabaseUrl(env?: NodeJS.ProcessEnv): string | undefined
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const { ensureDatabaseUrl } = require('./runtime-config')
|
||||||
|
const { PrismaClient } = require('../generated')
|
||||||
|
|
||||||
|
ensureDatabaseUrl()
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
PrismaClient,
|
||||||
|
ensureDatabaseUrl,
|
||||||
|
}
|
||||||
Vendored
+74
@@ -0,0 +1,74 @@
|
|||||||
|
export declare function ensureDatabaseUrl(env?: NodeJS.ProcessEnv): string | undefined
|
||||||
|
|
||||||
|
export type AdminRole = 'SUPER_ADMIN' | 'ADMIN' | 'SUPPORT' | 'FINANCE' | 'VIEWER'
|
||||||
|
export type EmployeeRole = 'OWNER' | 'MANAGER' | 'AGENT'
|
||||||
|
export type LicenseStatus = 'PENDING' | 'VALID' | 'EXPIRING' | 'APPROVED' | 'DENIED' | 'EXPIRED'
|
||||||
|
export type NotificationType =
|
||||||
|
| 'ACCOUNT_CREATED'
|
||||||
|
| 'NEW_BOOKING'
|
||||||
|
| 'BOOKING_CANCELLED'
|
||||||
|
| 'PAYMENT_RECEIVED'
|
||||||
|
| 'PAYMENT_FAILED'
|
||||||
|
| 'SUBSCRIPTION_TRIAL_ENDING'
|
||||||
|
| 'SUBSCRIPTION_SUSPENDED'
|
||||||
|
| 'VEHICLE_MAINTENANCE_DUE'
|
||||||
|
| 'OFFER_EXPIRING'
|
||||||
|
| 'NEW_REVIEW_RECEIVED'
|
||||||
|
| 'BOOKING_CONFIRMED'
|
||||||
|
| 'PICKUP_REMINDER_24H'
|
||||||
|
| 'PICKUP_REMINDER_2H'
|
||||||
|
| 'VEHICLE_READY'
|
||||||
|
| 'RETURN_REMINDER'
|
||||||
|
| 'BOOKING_CANCELLED_BY_COMPANY'
|
||||||
|
| 'REFUND_PROCESSED'
|
||||||
|
| 'NEW_OFFER_FROM_SAVED_COMPANY'
|
||||||
|
| 'REVIEW_REQUEST'
|
||||||
|
|
||||||
|
export type NotificationChannel = 'EMAIL' | 'SMS' | 'WHATSAPP' | 'IN_APP' | 'PUSH'
|
||||||
|
|
||||||
|
export interface Company {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
slug: string
|
||||||
|
email: string
|
||||||
|
phone: string | null
|
||||||
|
status: string
|
||||||
|
apiKey: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Employee {
|
||||||
|
id: string
|
||||||
|
companyId: string
|
||||||
|
clerkUserId: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
email: string
|
||||||
|
phone: string | null
|
||||||
|
role: EmployeeRole
|
||||||
|
isActive: boolean
|
||||||
|
company?: Company
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AdminUser {
|
||||||
|
id: string
|
||||||
|
email: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
role: AdminRole
|
||||||
|
isActive: boolean
|
||||||
|
totpEnabled?: boolean
|
||||||
|
totpSecret?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface InsurancePolicy {
|
||||||
|
id: string
|
||||||
|
companyId: string
|
||||||
|
name: string
|
||||||
|
description?: string | null
|
||||||
|
type: string
|
||||||
|
chargeType: 'PER_DAY' | 'PER_RENTAL' | 'PERCENTAGE_OF_RENTAL'
|
||||||
|
chargeValue: number
|
||||||
|
isRequired: boolean
|
||||||
|
isActive: boolean
|
||||||
|
sortOrder: number
|
||||||
|
}
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
const { ensureDatabaseUrl } = require('./runtime-config')
|
const { ensureDatabaseUrl } = require('./runtime-config')
|
||||||
const { PrismaClient } = require('../generated')
|
|
||||||
|
|
||||||
ensureDatabaseUrl()
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
PrismaClient,
|
|
||||||
ensureDatabaseUrl,
|
ensureDatabaseUrl,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
import { ensureDatabaseUrl } from './runtime-config'
|
|
||||||
|
|
||||||
ensureDatabaseUrl()
|
|
||||||
|
|
||||||
export { PrismaClient } from '../generated'
|
|
||||||
export { ensureDatabaseUrl } from './runtime-config'
|
export { ensureDatabaseUrl } from './runtime-config'
|
||||||
|
|
||||||
export type AdminRole = 'SUPER_ADMIN' | 'ADMIN' | 'SUPPORT' | 'FINANCE' | 'VIEWER'
|
export type AdminRole = 'SUPER_ADMIN' | 'ADMIN' | 'SUPPORT' | 'FINANCE' | 'VIEWER'
|
||||||
|
|||||||
Reference in New Issue
Block a user