Service Layer medium complexity Shared Component mobile
1
Dependencies
2
Dependents
2
Entities
0
Integrations

Description

Business logic layer for contact CRUD operations, shared across the Contact List & Search and Contact Detail & Edit features. Handles REST API communication for fetching and updating individual contacts, including server-side role enforcement on PATCH requests. Manages local cache invalidation after updates.

Feature: Contact Detail & Edit

contact-service

Responsibilities

  • Fetch single contact by ID from REST API with local cache fallback
  • Submit contact updates via PATCH /api/v1/contacts/:id with role-checked auth
  • Invalidate and refresh contact cache after successful edits
  • Propagate error responses with structured AppError types

Interfaces

getContactById(contactId: string): Future<Contact>
updateContact(contactId: string, data: ContactFormData): Future<Contact>
createContact(data: ContactFormData): Future<Contact>
deleteContact(contactId: string): Future<void>
searchContacts(query: string): Future<List<Contact>>
getContactsByFeature(featureContext: string): Future<List<Contact>>
invalidateCache(contactId: string)

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component