import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../../services/storage.service";
import * as i2 from "../../../services/rest.service";
import * as i3 from "@angular/common";
export class PassbookTransactionsComponent {
    constructor(storageService, restService) {
        this.storageService = storageService;
        this.restService = restService;
        this.allTransactions = [];
    }
    ngOnInit() {
        this.getAllTransactions();
    }
    getAllTransactions() {
        const userDetails = this.storageService.getUser();
        const userId = userDetails?.userId;
        let payload = {
            id: userId,
            businessId: localStorage.getItem('bId'),
            isPagination: false
        };
        this.restService.getAllTransactions(payload).subscribe((res) => {
            if (res) {
                this.allTransactions = res?.data?.data;
            }
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PassbookTransactionsComponent, deps: [{ token: i1.StorageServiceService }, { token: i2.RestService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PassbookTransactionsComponent, isStandalone: true, selector: "simpo-passbook-transactions", ngImport: i0, template: "<section class=\"total-container p-2 h-100\">\n    <div class=\"d-flex text-start fs-20 lh-28 fw-bold clr-primary mb-3 p-1\">\n        Transactions\n    </div>\n    <div class=\"transactions h-100 overflow-scroll p-1\" *ngIf=\"(allTransactions?.length ?? 0) > 0; else emptyScreen\">\n        <div class=\"transaction w-100 p-3 d-flex justify-content-between align-items-center bx-shd mb-3\"\n            *ngFor=\"let transaction of allTransactions\">\n            <div class=\"left d-flex align-items-center gap-3\">\n                <div class=\"d-flex image_container\">\n                    <img src=\"https://d2z9497xp8xb12.cloudfront.net/prod-images/558782c1755619706471Group 1707484906.png\"\n                        alt=\"load\">\n                </div>\n                <div class=\"d-flex flex-column\">\n                    <div class=\"top lh-20 fw-bold clr-primary\">{{transaction?.emiMonthCount ? transaction?.emiMonthCount\n                        : 'N/A' }} Instalment Paid</div>\n                    <div class=\"bottom d-flex gap-2\">\n                        <div class=\"fs-14 lh-20 clr-secondary transaction_date fw-bold\">\n                            {{transaction?.paidDate ? (transaction?.paidDate | date:'dd-MM-yyyy':'UTC') : 'N/A'}}\n                        </div>\n                        <div class=\"fs-14 lh-20 clr-secondary fw-bold plan_name\">\n                            &#x2022;&nbsp;&nbsp;{{transaction?.planName ? transaction?.planName : 'N/A'}}\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"d-flex text-end\">\n                <div class=\"fs-18 lh-28 fw-bold clr-primary installment_amount\">\u20B9 {{transaction?.paidAmount ?\n                    transaction?.paidAmount :\n                    'N/A'}}</div>\n            </div>\n        </div>\n    </div>\n</section>\n\n<ng-template #emptyScreen>\n  <div class=\"no-transaction-text\">\n    <img src=\"https://d2z9497xp8xb12.cloudfront.net/prod-images/870195c1756931532322transaction.png\" alt=\"\">\n    <p>No Transaction</p>\n  </div>\n</ng-template>\n", styles: ["*{font-family:var(--website-font-family)}.fs-20{font-size:20px}.fs-18{font-size:18px}.fs-14{font-size:14px}.lh-28{line-height:28px}.lh-20{line-height:20px}.clr-primary{color:#020817}.clr-secondary{color:#0006}.bx-shd{box-shadow:#63636333 0 2px 8px;border-radius:8px}@media only screen and (max-width:475px){.total-container{padding:unset!important}.plan_name,.transaction_date,.installment_amount{font-size:10px;white-space:nowrap}.image_container{width:30px}.image_container img{width:100%}}.no-transaction-text{height:90%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.no-transaction-text img{height:20%}.no-transaction-text p{font-size:18px;font-weight:500}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PassbookTransactionsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-passbook-transactions', standalone: true, imports: [CommonModule], template: "<section class=\"total-container p-2 h-100\">\n    <div class=\"d-flex text-start fs-20 lh-28 fw-bold clr-primary mb-3 p-1\">\n        Transactions\n    </div>\n    <div class=\"transactions h-100 overflow-scroll p-1\" *ngIf=\"(allTransactions?.length ?? 0) > 0; else emptyScreen\">\n        <div class=\"transaction w-100 p-3 d-flex justify-content-between align-items-center bx-shd mb-3\"\n            *ngFor=\"let transaction of allTransactions\">\n            <div class=\"left d-flex align-items-center gap-3\">\n                <div class=\"d-flex image_container\">\n                    <img src=\"https://d2z9497xp8xb12.cloudfront.net/prod-images/558782c1755619706471Group 1707484906.png\"\n                        alt=\"load\">\n                </div>\n                <div class=\"d-flex flex-column\">\n                    <div class=\"top lh-20 fw-bold clr-primary\">{{transaction?.emiMonthCount ? transaction?.emiMonthCount\n                        : 'N/A' }} Instalment Paid</div>\n                    <div class=\"bottom d-flex gap-2\">\n                        <div class=\"fs-14 lh-20 clr-secondary transaction_date fw-bold\">\n                            {{transaction?.paidDate ? (transaction?.paidDate | date:'dd-MM-yyyy':'UTC') : 'N/A'}}\n                        </div>\n                        <div class=\"fs-14 lh-20 clr-secondary fw-bold plan_name\">\n                            &#x2022;&nbsp;&nbsp;{{transaction?.planName ? transaction?.planName : 'N/A'}}\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"d-flex text-end\">\n                <div class=\"fs-18 lh-28 fw-bold clr-primary installment_amount\">\u20B9 {{transaction?.paidAmount ?\n                    transaction?.paidAmount :\n                    'N/A'}}</div>\n            </div>\n        </div>\n    </div>\n</section>\n\n<ng-template #emptyScreen>\n  <div class=\"no-transaction-text\">\n    <img src=\"https://d2z9497xp8xb12.cloudfront.net/prod-images/870195c1756931532322transaction.png\" alt=\"\">\n    <p>No Transaction</p>\n  </div>\n</ng-template>\n", styles: ["*{font-family:var(--website-font-family)}.fs-20{font-size:20px}.fs-18{font-size:18px}.fs-14{font-size:14px}.lh-28{line-height:28px}.lh-20{line-height:20px}.clr-primary{color:#020817}.clr-secondary{color:#0006}.bx-shd{box-shadow:#63636333 0 2px 8px;border-radius:8px}@media only screen and (max-width:475px){.total-container{padding:unset!important}.plan_name,.transaction_date,.installment_amount{font-size:10px;white-space:nowrap}.image_container{width:30px}.image_container img{width:100%}}.no-transaction-text{height:90%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.no-transaction-text img{height:20%}.no-transaction-text p{font-size:18px;font-weight:500}\n"] }]
        }], ctorParameters: () => [{ type: i1.StorageServiceService }, { type: i2.RestService }] });
//# sourceMappingURL=data:application/json;base64, 