# All files / codegen/models CustomerPortalInvoice.ts

72.77% Statements 131/180
100% Branches 0/0
0% Functions 0/3
72.77% Lines 131/180

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    1821x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x
    1x

    1x
    1x

     /* tslint:disable */
    /* eslint-disable */
    /**
     * Octane API
     * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     *
     * The version of the OpenAPI document: 1.0.0
     *
     *
     * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
     * https://openapi-generator.tech
     * Do not edit the class manually.
     */

    import { exists, mapValues } from '../runtime';
    import {
        CustomerPortalInvoiceStatus,
        CustomerPortalInvoiceStatusFromJSON,
        CustomerPortalInvoiceStatusFromJSONTyped,
        CustomerPortalInvoiceStatusToJSON,
    } from './CustomerPortalInvoiceStatus';
    import {
        LineItems,
        LineItemsFromJSON,
        LineItemsFromJSONTyped,
        LineItemsToJSON,
    } from './LineItems';

    /**
     *
     * @export
     * @interface CustomerPortalInvoice
     */
    export interface CustomerPortalInvoice {
        /**
         * [DEPRECATED] Start time of the cycle in which the invoice was generated
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        startTime?: Date;
        /**
         * Amount due before any credits are applied
         * @type {number}
         * @memberof CustomerPortalInvoice
         */
        subTotal?: number;
        /**
         * Url pointing to the pdf of this invoice.
         * @type {string}
         * @memberof CustomerPortalInvoice
         */
        pdfUrl?: string;
        /**
         * Information related to the current status of this invoice.
         * @type {CustomerPortalInvoiceStatus}
         * @memberof CustomerPortalInvoice
         */
        status?: CustomerPortalInvoiceStatus | null;
        /**
         *
         * @type {Array<LineItems>}
         * @memberof CustomerPortalInvoice
         */
        lineItems?: Array<LineItems>;
        /**
         * Earliest start time of line items covered by the invoice
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        minItemStartTime?: Date;
        /**
         *
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        dueDate?: Date;
        /**
         * The date the invoice will be issued to the end customer or forwarded to the payment processor.
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        issueDate?: Date;
        /**
         * Any discount credits applied to the invoice
         * @type {number}
         * @memberof CustomerPortalInvoice
         */
        discountCredit?: number;
        /**
         * Tax amount applied to subtotal
         * @type {number}
         * @memberof CustomerPortalInvoice
         */
        taxAmount?: number;
        /**
         * [DEPRECATED] End time of the cycle in which the invoice was generated
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        endTime?: Date;
        /**
         * Total amount due
         * @type {number}
         * @memberof CustomerPortalInvoice
         */
        amountDue?: number;
        /**
         * False if not paid yet
         * @type {boolean}
         * @memberof CustomerPortalInvoice
         */
        isPaid?: boolean;
        /**
         *
         * @type {string}
         * @memberof CustomerPortalInvoice
         */
        id?: string;
        /**
         * Latest end time of line items covered by the invoice
         * @type {Date}
         * @memberof CustomerPortalInvoice
         */
        maxItemEndTime?: Date;
    }

    export function CustomerPortalInvoiceFromJSON(json: any): CustomerPortalInvoice {
        return CustomerPortalInvoiceFromJSONTyped(json, false);
    }

    export function CustomerPortalInvoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerPortalInvoice {
        if ((json === undefined) || (json === null)) {
            return json;
        }
        return {

            'startTime': !exists(json, 'start_time') ? undefined : (new Date(json['start_time'])),
            'subTotal': !exists(json, 'sub_total') ? undefined : json['sub_total'],
            'pdfUrl': !exists(json, 'pdf_url') ? undefined : json['pdf_url'],
            'status': !exists(json, 'status') ? undefined : CustomerPortalInvoiceStatusFromJSON(json['status']),
            'lineItems': !exists(json, 'line_items') ? undefined : ((json['line_items'] as Array<any>).map(LineItemsFromJSON)),
            'minItemStartTime': !exists(json, 'min_item_start_time') ? undefined : (new Date(json['min_item_start_time'])),
            'dueDate': !exists(json, 'due_date') ? undefined : (new Date(json['due_date'])),
            'issueDate': !exists(json, 'issue_date') ? undefined : (new Date(json['issue_date'])),
            'discountCredit': !exists(json, 'discount_credit') ? undefined : json['discount_credit'],
            'taxAmount': !exists(json, 'tax_amount') ? undefined : json['tax_amount'],
            'endTime': !exists(json, 'end_time') ? undefined : (new Date(json['end_time'])),
            'amountDue': !exists(json, 'amount_due') ? undefined : json['amount_due'],
            'isPaid': !exists(json, 'is_paid') ? undefined : json['is_paid'],
            'id': !exists(json, 'id') ? undefined : json['id'],
            'maxItemEndTime': !exists(json, 'max_item_end_time') ? undefined : (new Date(json['max_item_end_time'])),
        };
    }

    export function CustomerPortalInvoiceToJSON(value?: CustomerPortalInvoice | null): any {
        if (value === undefined) {
            return undefined;
        }
        if (value === null) {
            return null;
        }
        return {

            'start_time': value.startTime === undefined ? undefined : (value.startTime.toISOString()),
            'sub_total': value.subTotal,
            'pdf_url': value.pdfUrl,
            'status': CustomerPortalInvoiceStatusToJSON(value.status),
            'line_items': value.lineItems === undefined ? undefined : ((value.lineItems as Array<any>).map(LineItemsToJSON)),
            'min_item_start_time': value.minItemStartTime === undefined ? undefined : (value.minItemStartTime.toISOString()),
            'due_date': value.dueDate === undefined ? undefined : (value.dueDate.toISOString()),
            'issue_date': value.issueDate === undefined ? undefined : (value.issueDate.toISOString()),
            'discount_credit': value.discountCredit,
            'tax_amount': value.taxAmount,
            'end_time': value.endTime === undefined ? undefined : (value.endTime.toISOString()),
            'amount_due': value.amountDue,
            'is_paid': value.isPaid,
            'id': value.id,
            'max_item_end_time': value.maxItemEndTime === undefined ? undefined : (value.maxItemEndTime.toISOString()),
        };
    }