package app

import (
	"evening_detective_server/internal/repos"
	proto "evening_detective_server/proto"

	"google.golang.org/protobuf/types/known/timestamppb"
)

func mapUser(o *repos.User) *proto.User {
	return &proto.User{
		Id:        int32(o.ID),
		Username:  o.Username,
		Email:     o.Email,
		Roles:     o.Roles,
		IsActive:  o.IsActive,
		CreatedAt: timestamppb.New(o.CreatedAt),
	}
}
