fix tests and docker-compose

This commit is contained in:
root
2026-05-26 23:57:14 -04:00
parent 3f3b9d9e6a
commit f0c5d72523
8 changed files with 94 additions and 14 deletions
+6 -2
View File
@@ -22,11 +22,15 @@
"@types/bcryptjs": "^2.4.6"
},
"main": "./src/index.js",
"types": "./src/index.ts",
"types": "./src/index.d.ts",
"exports": {
".": {
"types": "./src/index.ts",
"types": "./src/index.d.ts",
"default": "./src/index.js"
},
"./client": {
"types": "./src/client.d.ts",
"default": "./src/client.js"
}
}
}
+2
View File
@@ -0,0 +1,2 @@
export { PrismaClient } from '../generated'
export declare function ensureDatabaseUrl(env?: NodeJS.ProcessEnv): string | undefined
+9
View File
@@ -0,0 +1,9 @@
const { ensureDatabaseUrl } = require('./runtime-config')
const { PrismaClient } = require('../generated')
ensureDatabaseUrl()
module.exports = {
PrismaClient,
ensureDatabaseUrl,
}
+74
View File
@@ -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
}
-4
View File
@@ -1,9 +1,5 @@
const { ensureDatabaseUrl } = require('./runtime-config')
const { PrismaClient } = require('../generated')
ensureDatabaseUrl()
module.exports = {
PrismaClient,
ensureDatabaseUrl,
}
-5
View File
@@ -1,8 +1,3 @@
import { ensureDatabaseUrl } from './runtime-config'
ensureDatabaseUrl()
export { PrismaClient } from '../generated'
export { ensureDatabaseUrl } from './runtime-config'
export type AdminRole = 'SUPER_ADMIN' | 'ADMIN' | 'SUPPORT' | 'FINANCE' | 'VIEWER'