You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: message.rs
    path of file: ./repos/rustfulapi/src/repo
    
    the code of the file until where you have to start completion: use chrono::Utc;
use sea_orm::{
  ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, DatabaseConnection, EntityTrait,
  QueryFilter, Set, TransactionTrait,
};
use uuid::Uuid;

use crate::{
  entity::{
    self,
    message::{MessageKind, MessageStatus},
  },
  error::AppResult,
};

#[tracing::instrument(skip_all)]
pub async fn find_by_user_and_kind<C>(
  conn: &C,
  user_id: Uuid,
  kind: MessageKind,
) -> AppResult<Option<entity::message::Model>>
where
  C: ConnectionTrait,
{
  let model = entity::message::Entity::find()
    .filter(
      entity::message::Column::UserId
        .eq(user_id)
        .and(entity::message::Column::Kind.eq(kind)),
    )
    .one(conn)
    .await?;
  Ok(model)
}

#[tracing::instrument(skip_all)]
pub async fn save<C>(conn: &C, user_id: Uuid, content: String, kind: MessageKind) -> AppResult<Uuid>
where
  C: ConnectionTrait,
{
  let model = crate::entity::message::ActiveModel {
    id: Set(Uuid::new_v4()),
    content: Set(content),
    status: Set(crate::entity::message::MessageStatus::Pending),
    kind: Set(kind),
    user_id: Set(user_id),
    create_at: Set(Utc::now()),
  
    
  async fn test_get_list_messages(ctx: &mut TransactionTestContext) {
    let user_id = crate::entity::user::Entity::find()
      .one(&**ctx)
      .await
      .unwrap()
      .unwrap()
      .id;
    entity::message::ActiveModel {
      id: Set(Uuid::new_v4()),
      kind: Set(MessageKind::ActiveCode),
      status: Set(MessageStatus::Pending),
      content: Set("code1".to_string()),
      user_id: Set(user_id),
      create_at: Set(Utc::now() - Duration::seconds(100)),
      update_at: Set(Utc::now() - Duration::seconds(100)),
    }
    .insert(&**ctx)
    .await
    .unwrap();
    entity::message::ActiveModel {
      id: Set(Uuid::new_v4()),
      kind: Set(MessageKind::ActiveCode),
      status: Set(MessageStatus::Pending),
      content: Set("code2".to_string()),
      user_id: Set(user_id),
      create_at: Set(Utc::now() - Duration::seconds(10)),
      update_at: Set(Utc::now() - Duration::seconds(10)),
    }
    .insert(&**ctx)
    .await
    .unwrap();
    entity::message::ActiveModel {
      id: Set(Uuid::new_v4()),
      kind: Set(MessageKind::ActiveCode),
      status: Set(MessageStatus::Pending),
      content: Set("code3".to_string()),
      user_id: Set(user_id),
      create_at: Set(Utc::now()),
      update_at: Set(Utc::now()),
    }
    .insert(&**ctx)
    .await
    .unwrap();
    let list = get_list_and_update(&**ctx, 100, 2).await.unwrap();
    assert_eq!(list.len(), 2);
    let list = get_list_and_update(&**ctx, 100, 2).await.unwrap();
    assert_eq!(list.len(), 1);
    assert_eq!(list.first().unwrap().content, "code3");
    let list = get_list_and_update(&**ctx, 100, 2).await.unwrap();
    assert_eq!(list.len(), 0);
  }