feat(documents): full regional doc set (front/back + criminal record) + CS data-entry + DB pool bump
- doc types with side (front/back/single): license, national_id, vehicle_registration (both sides), criminal_record, selfie, vehicle_photo - fields: side, holder_name(encrypted), issue_date, extra jsonb; REQUIRED_DOCS checklist + /requirements - CS/admin: POST /admin/drivers/:id/documents (upload for driver), list, review auto-approves when complete - face-match endpoint stub (Gemini/Face provider later) - DB pool extra.max=30 (raises concurrency ceiling); migration DocumentsFields Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,12 +9,14 @@ import {
|
||||
import { EncryptedTransformer } from '../../../common/crypto/crypto.util';
|
||||
|
||||
export type DocType =
|
||||
| 'license'
|
||||
| 'national_id'
|
||||
| 'vehicle_registration'
|
||||
| 'insurance'
|
||||
| 'selfie'
|
||||
| 'vehicle_photo';
|
||||
| 'license' // رخصة القيادة (وجهين)
|
||||
| 'national_id' // هوية الأحوال المدنية (وجهين)
|
||||
| 'vehicle_registration' // دفتر/بطاقة المركبة (وجهين)
|
||||
| 'insurance' // تأمين
|
||||
| 'criminal_record' // عدم محكومية (البحث الجنائي)
|
||||
| 'selfie' // صورة شخصية
|
||||
| 'vehicle_photo'; // صورة/صور السيارة
|
||||
export type DocSide = 'front' | 'back' | 'single';
|
||||
export type DocStatus = 'pending' | 'approved' | 'rejected';
|
||||
|
||||
/** وثيقة سائق (صورة + بيانات). الجدول: tripz_driver_documents. */
|
||||
@@ -34,6 +36,9 @@ export class DriverDocument {
|
||||
@Column()
|
||||
type: DocType;
|
||||
|
||||
@Column({ type: 'varchar', default: 'single' })
|
||||
side: DocSide; // front | back | single
|
||||
|
||||
@Column()
|
||||
file_key: string; // مفتاح التخزين (سيرفر التوطين لاحقاً)
|
||||
|
||||
@@ -41,9 +46,20 @@ export class DriverDocument {
|
||||
@Column({ type: 'varchar', nullable: true, transformer: EncryptedTransformer })
|
||||
number: string | null;
|
||||
|
||||
// اسم حامل الوثيقة — مشفّر at-rest
|
||||
@Column({ type: 'varchar', nullable: true, transformer: EncryptedTransformer })
|
||||
holder_name: string | null;
|
||||
|
||||
@Column({ type: 'date', nullable: true })
|
||||
issue_date: string | null;
|
||||
|
||||
@Column({ type: 'date', nullable: true })
|
||||
expiry_date: string | null;
|
||||
|
||||
// حقول إضافية يدخلها موظف خدمة العملاء (سلطة إصدار، ملاحظات...)
|
||||
@Column({ type: 'jsonb', default: {} })
|
||||
extra: Record<string, any>;
|
||||
|
||||
@Column({ type: 'varchar', default: 'pending' })
|
||||
status: DocStatus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user