db/heromodels/src/herodb/model_methods.rs
2025-06-03 21:50:08 +03:00

87 lines
3.1 KiB
Rust

use crate::db::db::DB;
use crate::db::model::Model;
use crate::impl_model_methods;
use crate::DbResult; // Add DbResult import
use crate::models::biz::{Product, Sale, Currency, ExchangeRate, Service, Customer, Contract, Invoice};
use crate::models::gov::{
Company, Shareholder, Meeting, User, Vote, Resolution,
Committee
// ComplianceRequirement, ComplianceDocument, ComplianceAudit - These don't exist
};
use crate::models::circle::{Circle, Member, Name, Wallet}; // Remove Asset
use crate::models::calendar::{Event, Calendar};
// Implement model-specific methods for Event
impl_model_methods!(Event, event, events);
// Implement model-specific methods for Calendar
impl_model_methods!(Calendar, calendar, calendars);
impl_model_methods!(Attendee, attendee, attendees);
// Implement model-specific methods for Product
impl_model_methods!(Product, product, products);
// Implement model-specific methods for Sale
impl_model_methods!(Sale, sale, sales);
// Implement model-specific methods for Currency
impl_model_methods!(Currency, currency, currencies);
// Implement model-specific methods for ExchangeRate
impl_model_methods!(ExchangeRate, exchange_rate, exchange_rates);
// Implement model-specific methods for Service
impl_model_methods!(Service, service, services);
// Implement model-specific methods for Customer
impl_model_methods!(Customer, customer, customers);
// Implement model-specific methods for Contract
impl_model_methods!(Contract, contract, contracts);
// Implement model-specific methods for Invoice
impl_model_methods!(Invoice, invoice, invoices);
// Implement model-specific methods for Company
impl_model_methods!(Company, company, companies);
// Implement model-specific methods for Shareholder
impl_model_methods!(Shareholder, shareholder, shareholders);
// Implement model-specific methods for Meeting
impl_model_methods!(Meeting, meeting, meetings);
// Implement model-specific methods for User
impl_model_methods!(User, user, users);
// Implement model-specific methods for Vote
impl_model_methods!(Vote, vote, votes);
// Implement model-specific methods for Resolution
impl_model_methods!(Resolution, resolution, resolutions);
// Implement model-specific methods for Committee
impl_model_methods!(Committee, committee, committees);
// These models don't exist, so comment them out
// // Implement model-specific methods for ComplianceRequirement
// impl_model_methods!(ComplianceRequirement, compliance_requirement, compliance_requirements);
// // Implement model-specific methods for ComplianceDocument
// impl_model_methods!(ComplianceDocument, compliance_document, compliance_documents);
// // Implement model-specific methods for ComplianceAudit
// impl_model_methods!(ComplianceAudit, compliance_audit, compliance_audits);
// Implement model-specific methods for Circle
impl_model_methods!(Circle, circle, circles);
// Implement model-specific methods for Member
impl_model_methods!(Member, member, members);
// Implement model-specific methods for Name
impl_model_methods!(Name, name, names);
// Implement model-specific methods for Wallet
impl_model_methods!(Wallet, wallet, wallets);