|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
import { ConfirmBoxEvokeService } from '@costlydeveloper/ngx-awesome-popup';
|
|
|
|
import { tesoMediaWatcherService } from '@teso/services/media-watcher';
|
|
|
|
import { AdminNewCouponsComponent } from './AdminNewCoupons/admin-new-coupons.component';
|
|
|
|
import { NewCouponsComponent } from './NewCoupons/new-coupons.component';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-coupons',
|
|
|
|
templateUrl: './coupons.component.html',
|
|
|
|
styleUrls: ['./coupons.component.scss']
|
|
|
|
})
|
|
|
|
export class CouponsComponent implements OnInit {
|
|
|
|
activecouponsData: MatTableDataSource<any> = new MatTableDataSource();
|
|
|
|
inactivecouponsData: MatTableDataSource<any> = new MatTableDataSource();
|
|
|
|
constructor(private router: Router, private _tesoMediaWatcherService: tesoMediaWatcherService,
|
|
|
|
public dialog: MatDialog, private confirmBoxEvokeService: ConfirmBoxEvokeService) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.activecouponsData.data = [
|
|
|
|
{
|
|
|
|
id: '2bfa2be5-7688-48d5-b5ac-dc0d9ac97f14',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Nadia Mcknight',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '77a4383b-b5a5-4943-bc46-04c3431d1566',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Best Blackburn',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '8bb0f597-673a-47ca-8c77-2f83219cb9af',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Duncan Carver',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'c318e31f-1d74-49c5-8dae-2bc5805e2fdb',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Martin Richards',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '0a8bc517-631a-4a93-aacc-000fa2e8294c',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Candice Munoz',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'a4c9945a-757b-40b0-8942-d20e0543cabd',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Vickie Mosley',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'b8258ccf-48b5-46a2-9c95-e0bd7580c645',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Tina Harris',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'f004ea79-98fc-436c-9ba5-6cfe32fe583d',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Holt Manning',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '8b69fe2d-d7cc-4a3d-983d-559173e37d37',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Misty Ramsey',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
this.inactivecouponsData.data = [
|
|
|
|
{
|
|
|
|
id: '2bfa2be5-7688-48d5-b5ac-dc0d9ac97f14',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Nadia Mcknight',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '77a4383b-b5a5-4943-bc46-04c3431d1566',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Best Blackburn',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '8bb0f597-673a-47ca-8c77-2f83219cb9af',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Duncan Carver',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'c318e31f-1d74-49c5-8dae-2bc5805e2fdb',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Martin Richards',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '0a8bc517-631a-4a93-aacc-000fa2e8294c',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Candice Munoz',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'a4c9945a-757b-40b0-8942-d20e0543cabd',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Vickie Mosley',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'b8258ccf-48b5-46a2-9c95-e0bd7580c645',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Tina Harris',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'f004ea79-98fc-436c-9ba5-6cfe32fe583d',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Holt Manning',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '8b69fe2d-d7cc-4a3d-983d-559173e37d37',
|
|
|
|
expiration:"2022-03-15",
|
|
|
|
name: 'Misty Ramsey',
|
|
|
|
range: '60% - 95%',
|
|
|
|
condition: 'By one get one free',
|
|
|
|
quantity:17,
|
|
|
|
type: "Freebie",
|
|
|
|
claimed: 50,
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
generateCoupons(){
|
|
|
|
if (!true) {
|
|
|
|
const dialogRef = this.dialog.open(NewCouponsComponent, {
|
|
|
|
disableClose: true,
|
|
|
|
hasBackdrop: true,
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
const dialogRef = this.dialog.open(AdminNewCouponsComponent, {
|
|
|
|
disableClose: true,
|
|
|
|
hasBackdrop: true,
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|