Browse Source

Starting with the domain

main
Julio Biason 3 years ago
parent
commit
d82d27cbf7
  1. 21
      lib/src/domain/command.rs
  2. 19
      lib/src/domain/create_event.rs
  3. 20
      lib/src/domain/mod.rs
  4. 27
      lib/src/domain/project/create_project.rs
  5. 1
      lib/src/domain/project/mod.rs

21
lib/src/domain/command.rs

@ -0,0 +1,21 @@
/*
TIN - Time Tracking Application
Copyright (C) 2021 Julio Biason
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
pub trait Command {
fn execute(&self) -> Result<(), ()>;
}

19
lib/src/domain/create_event.rs

@ -0,0 +1,19 @@
/*
TIN - Time Tracking Application
Copyright (C) 2020-2021 Julio Biason
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
struct CreateEvent {}

20
lib/src/domain/mod.rs

@ -0,0 +1,20 @@
/*
TIN - Time Tracking Application
Copyright (C) 2021 Julio Biason
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
pub(crate) mod command;
pub mod project;

27
lib/src/domain/project/create_project.rs

@ -0,0 +1,27 @@
/*
TIN - Time tracking application
Copyright (C) 2021 Julio Biason
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use crate::domain::command::Command;
struct CreateProject(String);
impl Command for CreateProject {
fn execute(&self) -> Result<(), ()> {
Ok(())
}
}

1
lib/src/domain/project/mod.rs

@ -0,0 +1 @@
pub mod create_project;
Loading…
Cancel
Save