import * as Crypto from 'expo-crypto'; export interface Territory { id: string; territoryCode: string; municipality?: string; barangay?: string; area?: string; block?: string; assignedTo?: string; createdAt: number; updatedAt: number; } export function dbToTerritory(row: any): Territory { return { id: row.id, territoryCode: row.territory_code, municipality: row.municipality, barangay: row.barangay, area: row.area, block: row.block, assignedTo: row.assigned_to, createdAt: row.created_at, updatedAt: row.updated_at, }; } export function newTerritoryId(): string { return Crypto.randomUUID(); }