<commit_before>package OpenCloset::Share::Web::Controller::Coupon;
use Mojo::Base 'Mojolicious::Controller';

has schema => sub { shift->app->schema };

=head1 METHODS

=head2 validate

    POST /coupon/validate

=cut

sub validate {
    my $self = shift;
    my $v    = $self->validation;

    $v->required('code');
    return $self->error( 400, "쿠폰코드를 입력해주세요" ) if $v->has_error;

    my $order_id = $self->param('order_id');
    my $codes    = $v->every_param('code');
    my $code     = join( '-', @$codes );
    my ( $coupon, $err ) = $self->validate_code($code);
    $self->error( 400, $err ) if $err;

    my %columns = $coupon->get_columns;
    $self->render( json => \%columns );
}

1;<commit_msg>Fix typo<commit_after>package OpenCloset::Share::Web::Controller::Coupon;
use Mojo::Base 'Mojolicious::Controller';

has schema => sub { shift->app->schema };

=head1 METHODS

=head2 validate

    POST /coupon/validate

=cut

sub validate {
    my $self = shift;
    my $v    = $self->validation;

    $v->required('code');
    return $self->error( 400, "쿠폰코드를 입력해주세요" ) if $v->has_error;

    my $order_id = $self->param('order_id');
    my $codes    = $v->every_param('code');
    my $code     = join( '-', @$codes );
    my ( $coupon, $err ) = $self->coupon_validate($code);
    return $self->error( 400, $err ) if $err;

    my %columns = $coupon->get_columns;
    $self->render( json => \%columns );
}

1;
{'fraction_non_alphanumeric': 0.18926553672316385, 'fraction_numerical': 0.012711864406779662, 'mean_word_length': 3.36, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5554387', 'n_tokens_mistral': 561, 'n_tokens_neox': 550, 'n_words': 117}