package Daje::Database::Model::Super::KanbanCards;
use Mojo::Base 'Daje::Database::Model::Super::Common::Base', -base, -signatures, -async_await;
use v5.42;

# NAME
# ====
#
# Daje::Database::Model::Super::KanbanCards - Daje db model
#
# SYNOPSIS
# ========
#
#
#       use Daje::Database::Model::Super::KanbanCards;
#
#       my $table = Daje::Database::Model::Super::KanbanCards->new(db => $db);
#
#       my $result = $table->load_kanban_cards_pkey($self, $kanban_cards_pkey);
#
#       my $result = $table->load_kanban_priority_fkey($self, $kanban_priority_fkey);
#
#       my $result = $table->load_kanban_list_fkey($self, $kanban_list_fkey);
##
#       my $result = $table->insert($self, $data);
#
#       $table->update($self, $data) ;
#
#
# DESCRIPTION
# ===========
#
# Daje::Database::Model::Super::KanbanCards is a Model super class
#
# METHODS
# =======
#
#
# LICENSE
# =======
#
# Copyright (C) janeskil1525.
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
# AUTHOR
# ======
#
# janeskil1525 E<lt>janeskil1525@gmail.com
#

# This file is generated automatically by Daje Tools 2026-03-28 17:58:33.
# It will be re-created by Daje Tools again and any changes
# will be over written.
#
# <!-- Autogenerated file 2026-03-28 17:58:33 -->

our $VERSION = '0.01';

has 'fields' => '"kanban_cards_pkey", "editnum", "insby", "insdatetime", "modby", "moddatetime","title","description","startdate","duedate","completed","progress",
"kanban_priority_fkey",
"kanban_list_fkey","id","sort_order"';
has 'primary_key_name' => "kanban_cards_pkey";
has 'table_name' => "kanban_cards"; # 
has 'mandatory' => 'title,kanban_priority_fkey,kanban_list_fkey,id,sort_order,';
has 'workflow' => '';

async sub load_kanban_priority_fkey_p($self, $kanban_priority_fkey) {
    return $self->load_kanban_priority_fkey($kanban_priority_fkey);
}

sub load_kanban_priority_fkey($self, $kanban_priority_fkey) {
    return $self->load_fkey(
        $self->table_name, $self->fields(), "kanban_priority_fkey", $kanban_priority_fkey
    );
}
async sub load_kanban_list_fkey_p($self, $kanban_list_fkey) {
    return $self->load_kanban_list_fkey($kanban_list_fkey);
}

sub load_kanban_list_fkey($self, $kanban_list_fkey) {
    return $self->load_fkey(
        $self->table_name, $self->fields(), "kanban_list_fkey", $kanban_list_fkey
    );
}
async sub load_kanban_cards_pkey_p($self, $kanban_cards_pkey) {
    return $self->load_kanban_cards_pkey($kanban_cards_pkey);
}

sub load_kanban_cards_pkey($self, $kanban_cards_pkey) {
    return $self->load_pk(
        $self->table_name, $self->fields(), $self->primary_key_name(), $kanban_cards_pkey
    );
}

sub insert($self, $data) {
    my $result = $self->SUPER::insert(
        $self->table_name, $data, $self->primary_key_name
    );
    return $result;
}

sub update($self, $data) {
    return $self->SUPER::update
    (
        $self->table_name, $data,
            {
                $self->primary_key_name() => $data->{$self->primary_key_name()}
            }
    );
}

sub delete($self, $primary_key) {
    return $self->SUPER::delete($self->table_name, { $self->primary_key_name() => $primary_key});
}
1;

