| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: MIT |
| 3 | |
| 4 | mod mock_date_time_repository; |
| 5 | pub use mock_date_time_repository::*; |
| 6 | |
| 7 | mod mock_task_repository; |
| 8 | pub use mock_task_repository::*; |
| 9 | |
| 10 | use crate::mvc::models::{DateModel, TaskModel, TimeModel}; |
| 11 | |
| 12 | pub mod traits; |
| 13 | |
| 14 | pub fn date_time_repo() -> impl traits::DateTimeRepository + Clone { |
| 15 | MockDateTimeRepository::new( |
| 16 | current_date:DateModel { year: 2024, month: 6, day: 11 }, |
| 17 | current_time:TimeModel { hour: 16, minute: 43, second: 0 }, |
| 18 | time_stamp:1718183634, |
| 19 | ) |
| 20 | } |
| 21 | |
| 22 | pub fn task_repo() -> impl traits::TaskRepository + Clone { |
| 23 | MockTaskRepository::new(tasks:vec![ |
| 24 | TaskModel { title: "Learn Rust" .into(), done: true, due_date: 1717686537151 }, |
| 25 | TaskModel { title: "Learn Slint" .into(), done: true, due_date: 1717686537151 }, |
| 26 | TaskModel { |
| 27 | title: "Create project with Rust and Slint" .into(), |
| 28 | done: true, |
| 29 | due_date: 1717686537151, |
| 30 | }, |
| 31 | ]) |
| 32 | } |
| 33 | |