Add lead workflows, PDF signing, AR projects and photo gallery integration
This commit is contained in:
33
GasTankAR/Domain/Leads/LeadUseCases.swift
Normal file
33
GasTankAR/Domain/Leads/LeadUseCases.swift
Normal file
@ -0,0 +1,33 @@
|
||||
import Foundation
|
||||
|
||||
struct LoadLeadsUseCase {
|
||||
let repository: any LeadRepository
|
||||
|
||||
func execute(salesCode: String) async throws -> [Lead] {
|
||||
try await repository.leads(for: salesCode, query: LeadQuery())
|
||||
}
|
||||
}
|
||||
|
||||
struct SearchLeadsUseCase {
|
||||
let repository: any LeadRepository
|
||||
|
||||
func execute(salesCode: String, query: LeadQuery) async throws -> [Lead] {
|
||||
try await repository.leads(for: salesCode, query: query.normalized)
|
||||
}
|
||||
}
|
||||
|
||||
struct SetLeadBookmarkUseCase {
|
||||
let repository: any LeadRepository
|
||||
|
||||
func execute(_ bookmarked: Bool, leadID: String, salesCode: String) async throws -> Lead {
|
||||
try await repository.setBookmark(bookmarked, leadID: leadID, salesCode: salesCode)
|
||||
}
|
||||
}
|
||||
|
||||
struct GetLeadUseCase {
|
||||
let repository: any LeadRepository
|
||||
|
||||
func execute(id: String, salesCode: String) async throws -> Lead {
|
||||
try await repository.lead(id: id, salesCode: salesCode)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user