11use {
2- crate :: { app_auth:: AuthApp , ar_date_format} ,
2+ crate :: { app_auth:: AuthApp , ar_date_format, runner :: Runner } ,
33 chrono:: { DateTime , Utc } ,
44 serde:: { Deserialize , Serialize } ,
55 serde_repr:: { Deserialize_repr , Serialize_repr } ,
@@ -18,6 +18,7 @@ pub struct Config {
1818pub struct Project {
1919 pub id : i32 ,
2020 pub name : String ,
21+ pub runner : Runner ,
2122 pub repository : Option < String > ,
2223 pub description : Option < String > ,
2324 pub created_at : DateTime < Utc > ,
@@ -29,11 +30,13 @@ impl Display for Project {
2930 write ! ( f, "ID: {}, Name: {}" , self . id, self . name, )
3031 }
3132}
32- #[ derive( Serialize , Debug ) ]
33+ #[ derive( Serialize , Debug , Deserialize , Clone ) ]
34+ #[ tsync]
3335pub struct ProjectCreate {
3436 pub name : String ,
3537 pub repository : String ,
3638 pub description : String ,
39+ pub runner : Runner ,
3740}
3841
3942#[ derive( Deserialize , Serialize , Debug ) ]
@@ -84,11 +87,13 @@ mod tests {
8487 name : "test" . to_owned ( ) ,
8588 repository : "test" . to_owned ( ) ,
8689 description : "test" . to_owned ( ) ,
90+ runner : Runner :: NodeJs ,
8791 } ;
8892 let json = json ! ( {
8993 "name" : "test" ,
9094 "repository" : "test" , // Corrected: repository should be included as per struct
9195 "description" : "test" ,
96+ "runner" : 0
9297 } ) ;
9398 assert_eq ! ( serde_json:: to_value( project_create) . unwrap( ) , json) ;
9499 }
0 commit comments