package Orchard::ManualAdjustmentCategory;

use strict;
use warnings;

sub new {
    my $class = shift;
    my $self  = {};
    bless $self, $class;
    $self;
}

sub categories {
    my $self = shift;
    {
        1  => "Label Earnings",
        2  => "Publisher Earnings",
        3  => "Legal Fees",
        4  => "Label Publisher Costs",
        5  => "Admin Fees",
        6  => "Reclass Between Labels",
        7  => "Returned Check",
        8  => "Stale Dated Check",
        9  => "Monthly Royalty Payment",
        10 => "Retroactive Performance Royalty Payment",
        11 => "System Release of Publishing Escrow",
        12 => "Manual Release of Publishing Escrow",
        13 => "Reversal of Encoding Fees",
        14 => "Foreign Withholding",
        15 => "Bank fees",
        16 => "Balance Roll forward",
        17 => "Bonus credit",
        18 => "Master License",
        19 => "Sync License",
        20 => "Reversal of Publishing",
        21 => "Out of Period payment",
        22 => "Label Advance",
        23 => "Publisher Advance",
        24 => "Check Fee",
        25 => "Reversal of Check Fee",
        26 => "Release Maintenance Fee",
        27 => "Forced Zero Out Balance",
        28 => "API Billing Charge",
        29 => "Offset to Pub Admin release from Accrual",
        30 => "Recoupable Interactive Marketing",
        31 => "Recoupable Facebook ADS",
        32 => "Physical Net Receipts Monthly balance",
        33 => "Domestic W9 Withholding",
        34 => "MKTPLACE-Moontoast",
        35 => "MKTPLACE-Ganxy",
        36 => "MKTPLACE-VoxBloc",
        37 => "MKTPLACE-Haulix",
        38 => "MKTPLACE-Mobile Backstage",
        39 => "MKTPLACE-Dockvine",
        40 => "MKTPLACE-FanBridge",
        41 => "MKTPLACE-MusicHype",
        42 => "MKTPLACE-webdoc",
        43 => "MKTPLACE-ShareSquare",
        44 => "MKTPLACE-Dropcards",
        45 => "MKTPLACE-BandRx",
        46 => "MKTPLACE-RocketHub",
        47 => "MKTPLACE-Fanzy",
        48 => "MKTPLACE-songpier",
        49 => "Treaty W/H Catch Up ",
        50 => "Treaty W/H Current",
        51 => "No U.S. Tax ID Catch Up",
        52 => "No U.S. Tax ID Current",
        53 => "Performance Royalties",
        54 => "IODA Label Earnings Adj.",
        55 => "IRIS Label Earnings Adj.",
        56 => "Wire Fee",
        57 => "Escheat Payments",
        58 => "Recoupable Film/Video Cost",
        59 => "Distribution - Theatrical",
        60 => "Distribution - Other",
        61 => "Marketing Assets",
        62 => "Advertising",
        63 => "Publicity",
        64 => "Outside Agency",
        65 => "Vendor Expense",
        66 => "Compilations",
        67 => "SAG Residuals",
        68 => "Physical Reserves Withheld",
        69 => "Physical Reserves Released",
        70 => "Breakage",
        71 => "Label Expenditure",
        72 => "Non-Recoupable Bonus",
        73 => "Orchard Profit Share",
        74 => "Physical Manufacturing",
        75 => "Physical Freight",
        76 => "Physical Storage",
        77 => "Physical Fees",
        78 => "Physical Coop",
        79 => "Physical Marketing",
        80 => "Physical Scrap",
        81 => "Physical Returns Processing",
        82 => "Physical Rework",
        83 => "Physical Receiving",
        84 => "Physical Other",
        85 => "Advance Recoupment",
        86 => "Spotify Payment",
        87 => "VAT Tax",
        88 => "Pure Merch",
        89 => "Direct Ad Sales",
        90 => "Podcast"
    };
}

sub getCategoryById {
    my $self = shift;
    my $id   = shift;
    $self->categories->{$id};
}

sub getCategoryIdByName {
    my $self = shift;
    my $name = shift;
    my $catid;
    foreach my $id ( sort keys %{ $self->categories } ) {
        $catid = $id if $self->getCategoryById($id) eq $name;
        last if $catid;
    }
    $catid;
}

1;
