pleme-codegen 0.1.2

Code generation macros for Pleme services with Brazilian market features
Documentation
//! Simplified Domain Model macro for initial testing

use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};

/// Simplified implementation of the DomainModel derive macro
pub fn derive_domain_model(input: TokenStream) -> TokenStream {
    let input = parse_macro_input!(input as DeriveInput);
    let struct_name = &input.ident;
    
    // Generate basic implementations
    let expanded = quote! {
        impl #struct_name {
            /// Generate cache key for this entity instance
            pub fn cache_key(&self) -> String {
                format!("{}:{}:{}", "default_product", stringify!(#struct_name).to_lowercase(), uuid::Uuid::new_v4())
            }
            
            /// Database table name for this entity  
            pub const TABLE_NAME: &'static str = concat!(stringify!(#struct_name), "s");
            
            /// Create a new instance
            pub fn new() -> Self {
                Self::default()
            }
        }
    };
    
    TokenStream::from(expanded)
}