diff --git a/client/README.md b/client/README.md index 141014f..956e6ca 100644 --- a/client/README.md +++ b/client/README.md @@ -1,4 +1,4 @@ -# Dataspire lite client +# Dataspire Lite client ### Prerequisites > Docker active LTS diff --git a/client/src/app/apis/process/process-api.ts b/client/src/app/apis/process/process-api.ts new file mode 100644 index 0000000..38f0bf5 --- /dev/null +++ b/client/src/app/apis/process/process-api.ts @@ -0,0 +1,33 @@ +import {Observable} from "rxjs"; +import { + ClvClass, + CustomerLifetimeValue, + IdentifiedGuestSegmentation, + MutationStartProcessArgs, + Process, + QueryGetClvClassListArgs, + QueryGetCustomerLifetimeValueListArgs, + QueryGetProcessStateArgs, + QueryGetStatisticArgs, + QueryGetTotalRecordCountArgs, + Statistic +} from 'src/app/graphql/generated/graphql'; + + +export interface ProcessApis { + + startProcess(variables: MutationStartProcessArgs): Observable; + + getProcessState(variables: QueryGetProcessStateArgs): Observable; + + getTotalRecordCount(variables: QueryGetTotalRecordCountArgs): Observable; + + getCustomerLifetimeValueList(variables: QueryGetCustomerLifetimeValueListArgs): Observable>; + + getClvClassList(variables: QueryGetClvClassListArgs): Observable>; + + getIdentifiedGuestSegmentation(variables: QueryGetCustomerLifetimeValueListArgs): Observable>; + + getStatistic(variables: QueryGetStatisticArgs): Observable; + +} diff --git a/client/src/app/apis/process/process.apis.mock.service.ts b/client/src/app/apis/process/process.apis.mock.service.ts new file mode 100644 index 0000000..9b84488 --- /dev/null +++ b/client/src/app/apis/process/process.apis.mock.service.ts @@ -0,0 +1,1289 @@ +import {Injectable} from '@angular/core'; +import {ExecuteGraphqlService} from '../../services/execute-graphql.service'; +import {Observable, of} from 'rxjs'; +import { + ClvClass, + CustomerLifetimeValue, + IdentifiedGuestSegmentation, + MutationStartProcessArgs, + Process, + QueryGetClvClassListArgs, + QueryGetCustomerLifetimeValueListArgs, + QueryGetProcessStateArgs, + QueryGetStatisticArgs, + QueryGetTotalRecordCountArgs, + Statistic +} from '../../graphql/generated/graphql'; +import {ProcessApis} from './process-api'; + + +@Injectable({ + providedIn: 'root' +}) +export class ProcessApisMockService implements ProcessApis { + + constructor(private execute: ExecuteGraphqlService) { + } + + + startProcess(variables: MutationStartProcessArgs): Observable { + return of(null); + } + + getProcessState(variables: QueryGetProcessStateArgs): Observable { + return of(null); + } + + getTotalRecordCount(variables: QueryGetTotalRecordCountArgs): Observable { + return of(451); + } + + getCustomerLifetimeValueList(variables: QueryGetCustomerLifetimeValueListArgs): Observable> { + + return of([{ + firstName: 'Vang', + lastName: 'Cherry', + email: 'vangcherry@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'House', + lastName: 'Sullivan', + email: 'housesullivan@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Montgomery', + lastName: 'Rojas', + email: 'montgomeryrojas@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Snider', + lastName: 'Padilla', + email: 'sniderpadilla@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Gale', + lastName: 'Kirby', + email: 'galekirby@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Mclean', + lastName: 'Gaines', + email: 'mcleangaines@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Gray', + lastName: 'Bright', + email: 'graybright@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Carolyn', + lastName: 'Ortega', + email: 'carolynortega@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Patterson', + lastName: 'Stephens', + email: 'pattersonstephens@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Noel', + lastName: 'Roth', + email: 'noelroth@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Stanley', + lastName: 'Doyle', + email: 'stanleydoyle@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Jimmie', + lastName: 'Aguilar', + email: 'jimmieaguilar@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Kent', + lastName: 'Baker', + email: 'kentbaker@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Salas', + lastName: 'Berg', + email: 'salasberg@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Stephanie', + lastName: 'Jarvis', + email: 'stephaniejarvis@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Jeanine', + lastName: 'Silva', + email: 'jeaninesilva@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Christian', + lastName: 'Walton', + email: 'christianwalton@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Sheree', + lastName: 'Head', + email: 'shereehead@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Chris', + lastName: 'Brooks', + email: 'chrisbrooks@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Savage', + lastName: 'Mcdonald', + email: 'savagemcdonald@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Sears', + lastName: 'Newman', + email: 'searsnewman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Bernadette', + lastName: 'Daugherty', + email: 'bernadettedaugherty@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Dunn', + lastName: 'Sexton', + email: 'dunnsexton@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Foley', + lastName: 'Swanson', + email: 'foleyswanson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Hutchinson', + lastName: 'Howe', + email: 'hutchinsonhowe@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Ratliff', + lastName: 'Huffman', + email: 'ratliffhuffman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Briggs', + lastName: 'Day', + email: 'briggsday@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'West', + lastName: 'Albert', + email: 'westalbert@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Rae', + lastName: 'Henderson', + email: 'raehenderson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lelia', + lastName: 'Wilkerson', + email: 'leliawilkerson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Simon', + lastName: 'Cobb', + email: 'simoncobb@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Cook', + lastName: 'Jacobson', + email: 'cookjacobson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Mcintyre', + lastName: 'Farley', + email: 'mcintyrefarley@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Frost', + lastName: 'Evans', + email: 'frostevans@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Wendy', + lastName: 'Wagner', + email: 'wendywagner@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Edwina', + lastName: 'Bradshaw', + email: 'edwinabradshaw@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Emily', + lastName: 'Chavez', + email: 'emilychavez@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Debbie', + lastName: 'Solis', + email: 'debbiesolis@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Jane', + lastName: 'Vincent', + email: 'janevincent@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Stanton', + lastName: 'Wright', + email: 'stantonwright@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Marguerite', + lastName: 'Moreno', + email: 'margueritemoreno@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Ella', + lastName: 'Bruce', + email: 'ellabruce@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Jacobs', + lastName: 'Zimmerman', + email: 'jacobszimmerman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Hamilton', + lastName: 'Woods', + email: 'hamiltonwoods@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Beulah', + lastName: 'Wallace', + email: 'beulahwallace@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Shepherd', + lastName: 'Blake', + email: 'shepherdblake@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Murray', + lastName: 'Hayes', + email: 'murrayhayes@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Ruby', + lastName: 'Holden', + email: 'rubyholden@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lorraine', + lastName: 'Garcia', + email: 'lorrainegarcia@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Helen', + lastName: 'Waller', + email: 'helenwaller@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Simone', + lastName: 'Henson', + email: 'simonehenson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Graham', + lastName: 'Mcclain', + email: 'grahammcclain@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Wilkins', + lastName: 'Young', + email: 'wilkinsyoung@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Johnston', + lastName: 'Hull', + email: 'johnstonhull@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Elena', + lastName: 'Ewing', + email: 'elenaewing@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Taylor', + lastName: 'Pearson', + email: 'taylorpearson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Hampton', + lastName: 'Barrera', + email: 'hamptonbarrera@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Thelma', + lastName: 'Zamora', + email: 'thelmazamora@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lacey', + lastName: 'Randall', + email: 'laceyrandall@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Mcclain', + lastName: 'Rogers', + email: 'mcclainrogers@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Rose', + lastName: 'Robbins', + email: 'roserobbins@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Bryan', + lastName: 'Ramirez', + email: 'bryanramirez@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Hensley', + lastName: 'Gilmore', + email: 'hensleygilmore@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Webb', + lastName: 'Cross', + email: 'webbcross@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Holloway', + lastName: 'Conner', + email: 'hollowayconner@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Shelley', + lastName: 'Hebert', + email: 'shelleyhebert@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Burnett', + lastName: 'Schwartz', + email: 'burnettschwartz@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Glenda', + lastName: 'Sawyer', + email: 'glendasawyer@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Rodgers', + lastName: 'Norman', + email: 'rodgersnorman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Fanny', + lastName: 'Black', + email: 'fannyblack@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Judy', + lastName: 'Alston', + email: 'judyalston@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Pugh', + lastName: 'Ellison', + email: 'pughellison@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Montoya', + lastName: 'Webster', + email: 'montoyawebster@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Schneider', + lastName: 'Ortiz', + email: 'schneiderortiz@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Dollie', + lastName: 'Gamble', + email: 'dolliegamble@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Riggs', + lastName: 'Nolan', + email: 'riggsnolan@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Donna', + lastName: 'Clarke', + email: 'donnaclarke@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Dawson', + lastName: 'Leach', + email: 'dawsonleach@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Deann', + lastName: 'Hines', + email: 'deannhines@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Eaton', + lastName: 'Howell', + email: 'eatonhowell@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Clark', + lastName: 'Coleman', + email: 'clarkcoleman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Luann', + lastName: 'Pierce', + email: 'luannpierce@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Sharp', + lastName: 'Villarreal', + email: 'sharpvillarreal@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Henrietta', + lastName: 'Hunt', + email: 'henriettahunt@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Rosemarie', + lastName: 'Fulton', + email: 'rosemariefulton@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Josefa', + lastName: 'Salinas', + email: 'josefasalinas@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Desiree', + lastName: 'Tate', + email: 'desireetate@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Merle', + lastName: 'Melton', + email: 'merlemelton@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Faith', + lastName: 'Dodson', + email: 'faithdodson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Velazquez', + lastName: 'Terry', + email: 'velazquezterry@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Deloris', + lastName: 'Vaughan', + email: 'delorisvaughan@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Amelia', + lastName: 'Wolf', + email: 'ameliawolf@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Mullins', + lastName: 'Watts', + email: 'mullinswatts@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Frederick', + lastName: 'Higgins', + email: 'frederickhiggins@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Adrian', + lastName: 'Morse', + email: 'adrianmorse@insource.com', + ltvClass: 3, + low: 0, + mid: 0, + high: 1, + type: 'Returning Guest' + }, { + firstName: 'Gillespie', + lastName: 'Santana', + email: 'gillespiesantana@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Faulkner', + lastName: 'Bryant', + email: 'faulknerbryant@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Duke', + lastName: 'Mcdaniel', + email: 'dukemcdaniel@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Bright', + lastName: 'Lester', + email: 'brightlester@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Dana', + lastName: 'Booker', + email: 'danabooker@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Susanne', + lastName: 'Lowery', + email: 'susannelowery@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lina', + lastName: 'Weeks', + email: 'linaweeks@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Earline', + lastName: 'Cervantes', + email: 'earlinecervantes@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Marion', + lastName: 'Ayers', + email: 'marionayers@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lenore', + lastName: 'Petty', + email: 'lenorepetty@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Katelyn', + lastName: 'Lynn', + email: 'katelynlynn@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Le', + lastName: 'Chang', + email: 'lechang@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Evelyn', + lastName: 'Sharpe', + email: 'evelynsharpe@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Adrienne', + lastName: 'Glover', + email: 'adrienneglover@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Marcella', + lastName: 'Wise', + email: 'marcellawise@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Wells', + lastName: 'Dale', + email: 'wellsdale@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Roberts', + lastName: 'Mays', + email: 'robertsmays@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Hopper', + lastName: 'Robinson', + email: 'hopperrobinson@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Belinda', + lastName: 'Daniels', + email: 'belindadaniels@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Miriam', + lastName: 'Roman', + email: 'miriamroman@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Marisa', + lastName: 'Gomez', + email: 'marisagomez@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lourdes', + lastName: 'Mcmahon', + email: 'lourdesmcmahon@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Johns', + lastName: 'Ellis', + email: 'johnsellis@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Sharron', + lastName: 'Stewart', + email: 'sharronstewart@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Paulette', + lastName: 'Talley', + email: 'paulettetalley@insource.com', + ltvClass: 1, + low: 1, + mid: 0, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Caroline', + lastName: 'Hamilton', + email: 'carolinehamilton@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Maria', + lastName: 'Griffin', + email: 'mariagriffin@insource.com', + ltvClass: 2, + low: 0, + mid: 1, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Schwartz', + lastName: 'Branch', + email: 'schwartzbranch@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Melisa', + lastName: 'Beasley', + email: 'melisabeasley@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Lola', + lastName: 'Delacruz', + email: 'loladelacruz@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Goodwin', + lastName: 'Chaney', + email: 'goodwinchaney@insource.com', + ltvClass: 2, + low: 0, + mid: 1, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Sofia', + lastName: 'Callahan', + email: 'sofiacallahan@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Osborn', + lastName: 'Diaz', + email: 'osborndiaz@insource.com', + ltvClass: 2, + low: 0, + mid: 1, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Tamera', + lastName: 'Cox', + email: 'tameracox@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Tracey', + lastName: 'Sykes', + email: 'traceysykes@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Marks', + lastName: 'Hunter', + email: 'markshunter@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Stuart', + lastName: 'Sweet', + email: 'stuartsweet@insource.com', + ltvClass: 2, + low: 0, + mid: 1, + high: 0, + type: 'Returning Guest' + }, { + firstName: 'Nelson', + lastName: 'Irwin', + email: 'nelsonirwin@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Shepard', + lastName: 'Solomon', + email: 'shepardsolomon@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }, { + firstName: 'Garza', + lastName: 'Stein', + email: 'garzastein@insource.com', + ltvClass: 2, + low: 0.32, + mid: 0.52, + high: 0.16, + type: '1st-Time Guest' + }]); + } + + getClvClassList(variables: QueryGetClvClassListArgs): Observable> { + return of([{ + name: 'Low', + typeList: [{name: '1st-Time Guest', value: 0}, {name: 'Returning Guest', value: 8}] + }, { + name: 'Medium', + typeList: [{name: '1st-Time Guest', value: 122}, {name: 'Returning Guest', value: 4}] + }, { + name: 'High', + typeList: [{name: '1st-Time Guest', value: 0}, {name: 'Returning Guest', value: 1}] + }]); + } + + getIdentifiedGuestSegmentation(variables: QueryGetCustomerLifetimeValueListArgs): Observable> { + return of([ + { + segment: 'Returning Guest', value: 0.0962962962962963 + }, { + segment: '1st-Time Guest', + value: 0.9037037037037037 + } + ]); + } + + getStatistic(variables: QueryGetStatisticArgs): Observable { + return of({totalIdentifiedGuest: 135, totalPotentialVipGuest: 0, highValueGuest: 1}); + } + +} diff --git a/client/src/app/apis/process.apis.service.ts b/client/src/app/apis/process/process.apis.service.ts similarity index 87% rename from client/src/app/apis/process.apis.service.ts rename to client/src/app/apis/process/process.apis.service.ts index 85ebda5..d993901 100644 --- a/client/src/app/apis/process.apis.service.ts +++ b/client/src/app/apis/process/process.apis.service.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; import {map} from 'rxjs/operators'; -import {ExecuteGraphqlService} from '../services/execute-graphql.service'; +import {ExecuteGraphqlService} from '../../services/execute-graphql.service'; import {Observable} from 'rxjs'; -import {MutationStartProcessDocs} from '../graphql/generated/mutations'; +import {MutationStartProcessDocs} from '../../graphql/generated/mutations'; import { ClvClass, CustomerLifetimeValue, @@ -15,7 +15,7 @@ import { QueryGetStatisticArgs, QueryGetTotalRecordCountArgs, Statistic -} from '../graphql/generated/graphql'; +} from '../../graphql/generated/graphql'; import { QueryGetClvClassListDocs, QueryGetCustomerLifetimeValueListDocs, @@ -23,13 +23,14 @@ import { QueryGetProcessStateDocs, QueryGetStatisticDocs, QueryGetTotalRecordCountDocs -} from '../graphql/generated/queries'; +} from '../../graphql/generated/queries'; +import {ProcessApis} from './process-api'; @Injectable({ providedIn: 'root' }) -export class ProcessApisService { +export class ProcessApisService implements ProcessApis { constructor(private execute: ExecuteGraphqlService) { } diff --git a/client/src/app/graphql/generated/queries.ts b/client/src/app/graphql/generated/queries.ts index 832bf1f..bd79129 100644 --- a/client/src/app/graphql/generated/queries.ts +++ b/client/src/app/graphql/generated/queries.ts @@ -22,7 +22,10 @@ export const QueryGetClvClassListDocs = gql` export const QueryGetCustomerLifetimeValueListDocs = gql` query GetCustomerLifetimeValueList($filter: CustomerLifetimeValueFilter) { response: getCustomerLifetimeValueList(filter: $filter) { + firstName + lastName email + ltvClass low mid high diff --git a/client/src/app/graphql/queries/getCustomerLifetimeValueList.graphql b/client/src/app/graphql/queries/getCustomerLifetimeValueList.graphql index 251ee10..d51ff81 100644 --- a/client/src/app/graphql/queries/getCustomerLifetimeValueList.graphql +++ b/client/src/app/graphql/queries/getCustomerLifetimeValueList.graphql @@ -1,4 +1,3 @@ - query GetCustomerLifetimeValueList($filter: CustomerLifetimeValueFilter) { response: getCustomerLifetimeValueList(filter: $filter) { email diff --git a/client/src/app/modules/home/components/authentication-flow/authentication-flow.component.ts b/client/src/app/modules/home/components/authentication-flow/authentication-flow.component.ts index 2384548..2f00e64 100644 --- a/client/src/app/modules/home/components/authentication-flow/authentication-flow.component.ts +++ b/client/src/app/modules/home/components/authentication-flow/authentication-flow.component.ts @@ -8,7 +8,7 @@ import {environment} from '../../../../../environments/environment'; import {switchMap, tap} from 'rxjs/operators'; import {Process, TokenResponse} from '../../../../graphql/generated/graphql'; import {FormControl} from '@angular/forms'; -import {ProcessApisService} from '../../../../apis/process.apis.service'; +import {ProcessApisService} from '../../../../apis/process/process.apis.service'; import {LoadingService} from '../../../../services/loading.service'; import {ActivatedRoute} from '@angular/router'; import {noop, Observable} from 'rxjs'; diff --git a/client/src/app/modules/home/components/processing-flow/processing-flow.component.ts b/client/src/app/modules/home/components/processing-flow/processing-flow.component.ts index f581c61..a5fb0bd 100644 --- a/client/src/app/modules/home/components/processing-flow/processing-flow.component.ts +++ b/client/src/app/modules/home/components/processing-flow/processing-flow.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output} from '@angular/core'; -import {ProcessApisService} from '../../../../apis/process.apis.service'; +import {ProcessApisService} from '../../../../apis/process/process.apis.service'; import {ActivatedRoute} from '@angular/router'; import {interval, Observable} from 'rxjs'; import {Process, ProcessStatusEnum} from '../../../../graphql/generated/graphql'; diff --git a/client/src/app/shared/features/dashboard/dashboard.component.ts b/client/src/app/shared/features/dashboard/dashboard.component.ts index ba3d1af..1ddd014 100644 --- a/client/src/app/shared/features/dashboard/dashboard.component.ts +++ b/client/src/app/shared/features/dashboard/dashboard.component.ts @@ -1,11 +1,13 @@ import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; -import {ProcessApisService} from '../../../apis/process.apis.service'; +import {ProcessApisService} from '../../../apis/process/process.apis.service'; import {ActivatedRoute} from '@angular/router'; import {Observable} from 'rxjs'; import {Statistic} from '../../../graphql/generated/graphql'; -import {map, tap} from 'rxjs/operators'; -import {CookieService} from "ngx-cookie-service"; -import {TokenService} from "../../../services/token.service"; +import {map} from 'rxjs/operators'; +import {CookieService} from 'ngx-cookie-service'; +import {TokenService} from '../../../services/token.service'; +import {environment} from '../../../../environments/environment'; +import {ProcessApisMockService} from '../../../apis/process/process.apis.mock.service'; @Component({ selector: 'app-dashboard', @@ -42,7 +44,13 @@ import {TokenService} from "../../../services/token.service"; `, styleUrls: ['./dashboard.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + providers: [ + { + provide: ProcessApisService, + useClass: environment.production ? ProcessApisService : ProcessApisMockService, + }, + ] }) export class DashboardComponent implements OnInit { @@ -64,7 +72,6 @@ export class DashboardComponent implements OnInit { ngOnInit(): void { const processId = this.route.snapshot.queryParams?.id; - this.count$ = this.processApiService.getTotalRecordCount({filter: {processId}}); this.statistic$ = this.processApiService.getStatistic({filter: {processId}}); this.segmentationData$ = this.processApiService.getIdentifiedGuestSegmentation({filter: {processId}}) @@ -76,7 +83,6 @@ export class DashboardComponent implements OnInit { first: i?.typeList?.find(e => e?.name === '1st-Time Guest')?.value, second: i?.typeList?.find(e => e?.name === 'Returning Guest')?.value, }))), - tap(console.log) ); diff --git a/client/src/environments/environment.ts b/client/src/environments/environment.ts index 32d328d..02fc084 100644 --- a/client/src/environments/environment.ts +++ b/client/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiURL: `http://localhost:8000`, + apiURL: `https://lite-services.dataspire.io`, apaleoAPI: 'https://api.apaleo.com', authSetting: { scope: 'offline_access openid profile setup.manage',