twigs-ios/Twigs/Budget/BudgetRepository.swift

47 lines
1.1 KiB
Swift
Raw Normal View History

//
// BudgetRepository.swift
// Budget
//
// Created by Billy Brawner on 9/30/19.
// Copyright © 2019 William Brawner. All rights reserved.
//
import Foundation
import Combine
2022-01-03 17:56:43 +00:00
import TwigsCore
#if DEBUG
class MockBudgetRepository: BudgetRepository {
static let budget = Budget(
2021-09-10 04:47:57 +00:00
id: "1",
name: "Test Budget",
description: "A mock budget used for testing",
2021-09-10 04:47:57 +00:00
currencyCode: "USD"
)
2022-01-03 17:56:43 +00:00
func getBudgets(count: Int?, page: Int?) async throws -> [Budget] {
return [MockBudgetRepository.budget]
}
2022-01-03 17:56:43 +00:00
func getBudget(_ id: String) async throws -> Budget {
return MockBudgetRepository.budget
}
2022-01-03 17:56:43 +00:00
func newBudget(_ budget: Budget) async throws -> Budget {
return MockBudgetRepository.budget
}
2022-01-03 17:56:43 +00:00
func updateBudget(_ budget: Budget) async throws -> Budget {
return Budget(
2021-09-10 04:47:57 +00:00
id: "1",
name: "Test Budget",
description: "A mock budget used for testing",
2021-09-10 04:47:57 +00:00
currencyCode: "USD"
2022-01-03 17:56:43 +00:00
)
}
2022-01-03 17:56:43 +00:00
func deleteBudget(_ id: String) async throws {
}
}
#endif