init commit

This commit is contained in:
2024-10-30 02:02:12 +01:00
commit ea4942bda1
93 changed files with 9909 additions and 0 deletions

27
src/models/jobs.rs Normal file
View File

@@ -0,0 +1,27 @@
use super::_entities::jobs::{ActiveModel, Entity};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
pub type Jobs = Entity;
impl ActiveModelBehavior for ActiveModel {
// extend activemodel below (keep comment for generators)
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct JobWithTechnologies {
pub id: i32,
pub position: String,
pub company: String,
pub start_date: Date,
pub end_date: Option<Date>,
pub technologies: Vec<String>,
pub still_working: bool,
}
pub fn get_technologies_from_string(technologies: &str) -> Vec<String> {
technologies
.split(',')
.map(|s| s.to_string())
.filter(|s| !s.trim().is_empty())
.collect()
}