2019-10-12 19:03:50 +00:00
|
|
|
//
|
|
|
|
// 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
|
2019-10-12 19:03:50 +00:00
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
class MockBudgetRepository: BudgetRepository {
|
2019-10-13 01:22:09 +00:00
|
|
|
static let budget = Budget(
|
2021-09-10 04:47:57 +00:00
|
|
|
id: "1",
|
2019-10-19 22:18:06 +00:00
|
|
|
name: "Test Budget",
|
|
|
|
description: "A mock budget used for testing",
|
2021-09-10 04:47:57 +00:00
|
|
|
currencyCode: "USD"
|
2019-10-13 01:22:09 +00:00
|
|
|
)
|
|
|
|
|
2022-01-03 17:56:43 +00:00
|
|
|
func getBudgets(count: Int?, page: Int?) async throws -> [Budget] {
|
|
|
|
return [MockBudgetRepository.budget]
|
2019-10-12 19:03:50 +00:00
|
|
|
}
|
|
|
|
|
2022-01-03 17:56:43 +00:00
|
|
|
func getBudget(_ id: String) async throws -> Budget {
|
|
|
|
return MockBudgetRepository.budget
|
2019-10-12 19:03:50 +00:00
|
|
|
}
|
|
|
|
|
2022-01-03 17:56:43 +00:00
|
|
|
func newBudget(_ budget: Budget) async throws -> Budget {
|
|
|
|
return MockBudgetRepository.budget
|
2019-10-12 19:03:50 +00:00
|
|
|
}
|
|
|
|
|
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",
|
2019-10-12 19:03:50 +00:00
|
|
|
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
|
|
|
)
|
2019-10-12 19:03:50 +00:00
|
|
|
}
|
|
|
|
|
2022-01-03 17:56:43 +00:00
|
|
|
func deleteBudget(_ id: String) async throws {
|
2019-10-12 19:03:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|