Add create job endpoint

This commit is contained in:
2025-02-23 19:16:55 +01:00
parent bc2640dee0
commit b5699bd7c2
9 changed files with 100 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
use super::_entities::jobs::{ActiveModel, Entity};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use chrono::NaiveDate;
pub type Jobs = Entity;
impl ActiveModelBehavior for ActiveModel {
@@ -16,4 +18,15 @@ pub struct JobWithTechnologies {
pub end_date: Option<Date>,
pub technologies: Vec<String>,
pub still_working: bool,
}
#[derive(Serialize, Deserialize)]
pub struct CreateJobForm {
pub position: String,
pub company: String,
pub start_date: NaiveDate,
#[serde(default)]
pub end_date: Option<NaiveDate>,
pub technologies: String,
pub still_working: bool,
}