tango-app-api-store-builder 1.0.0-beta-61 → 1.0.0-beta-63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1076,7 +1076,7 @@ export async function fixtureShelfProductv1( req, res ) {
|
|
|
1076
1076
|
|
|
1077
1077
|
if ( [ 'L2', 'L4' ].includes( fixture.toObject().productResolutionLevel ) ) {
|
|
1078
1078
|
const fixtureShelves = await fixtureShelfService.find( { fixtureId: new mongoose.Types.ObjectId( fixtureId ) } );
|
|
1079
|
-
if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1079
|
+
// if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1080
1080
|
const productCount = await planoMappingService.count( { fixtureId: new mongoose.Types.ObjectId( fixtureId ), type: 'product' } );
|
|
1081
1081
|
const shelfProducts = await Promise.all(
|
|
1082
1082
|
fixtureShelves.map( async ( shelf ) => {
|
|
@@ -1090,7 +1090,7 @@ export async function fixtureShelfProductv1( req, res ) {
|
|
|
1090
1090
|
|
|
1091
1091
|
if ( fixture.toObject().productResolutionLevel === 'L3' ) {
|
|
1092
1092
|
const fixtureShelves = await fixtureShelfService.find( { fixtureId: new mongoose.Types.ObjectId( fixtureId ) } );
|
|
1093
|
-
if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1093
|
+
// if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1094
1094
|
const productCount = await planoMappingService.count( { fixtureId: new mongoose.Types.ObjectId( fixtureId ), type: 'product' } );
|
|
1095
1095
|
const groupedShelves = fixtureShelves.reduce( async ( accPromise, shelf ) => {
|
|
1096
1096
|
const acc = await accPromise;
|
|
@@ -2663,56 +2663,181 @@ export const getFixtureLengths = async ( req, res ) => {
|
|
|
2663
2663
|
|
|
2664
2664
|
export const getFixtureBrands = async ( req, res ) => {
|
|
2665
2665
|
try {
|
|
2666
|
-
const pipeline = [
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
];
|
|
2706
|
-
|
|
2707
|
-
const sections = await storeFixtureService.aggregate( pipeline );
|
|
2708
|
-
|
|
2709
|
-
if ( !sections.length ) {
|
|
2710
|
-
|
|
2711
|
-
}
|
|
2666
|
+
// const pipeline = [
|
|
2667
|
+
// {
|
|
2668
|
+
// '$match': {
|
|
2669
|
+
// 'clientId': req.body.clientId,
|
|
2670
|
+
// },
|
|
2671
|
+
// },
|
|
2672
|
+
// {
|
|
2673
|
+
// $project:
|
|
2674
|
+
// {
|
|
2675
|
+
// fixtureBrandCategory: 1,
|
|
2676
|
+
// },
|
|
2677
|
+
// },
|
|
2678
|
+
// {
|
|
2679
|
+
// '$match': {
|
|
2680
|
+
// '$and': [
|
|
2681
|
+
// { 'fixtureBrandCategory': { '$ne': null } },
|
|
2682
|
+
// { 'fixtureBrandCategory': { '$ne': '' } },
|
|
2683
|
+
// { 'fixtureBrandCategory': { '$ne': 'nil' } },
|
|
2684
|
+
// { 'fixtureBrandCategory': { '$not': { '$type': 'array' } } },
|
|
2685
|
+
// ],
|
|
2686
|
+
// },
|
|
2687
|
+
// },
|
|
2688
|
+
// {
|
|
2689
|
+
// $group: {
|
|
2690
|
+
// _id: '$fixtureBrandCategory',
|
|
2691
|
+
// },
|
|
2692
|
+
// },
|
|
2693
|
+
// {
|
|
2694
|
+
// $group: {
|
|
2695
|
+
// '_id': null,
|
|
2696
|
+
// 'fixtureBrandCategory': { '$push': '$_id' },
|
|
2697
|
+
// },
|
|
2698
|
+
// },
|
|
2699
|
+
// {
|
|
2700
|
+
// $project: {
|
|
2701
|
+
// _id: 0,
|
|
2702
|
+
// fixtureBrandCategory: 1,
|
|
2703
|
+
// },
|
|
2704
|
+
// },
|
|
2705
|
+
// ];
|
|
2706
|
+
|
|
2707
|
+
// const sections = await storeFixtureService.aggregate( pipeline );
|
|
2708
|
+
|
|
2709
|
+
// if ( !sections.length ) {
|
|
2710
|
+
// return res.sendError( 'No data found', 204 );
|
|
2711
|
+
// }
|
|
2712
2712
|
|
|
2713
|
-
const [ data ] = sections;
|
|
2713
|
+
// const [ data ] = sections;
|
|
2714
|
+
|
|
2715
|
+
const data = [
|
|
2716
|
+
'Acuvue',
|
|
2717
|
+
'Acuvue Moist',
|
|
2718
|
+
'Acuvue Oasys',
|
|
2719
|
+
'Acuvue Vita',
|
|
2720
|
+
'Air Optix',
|
|
2721
|
+
'Alcon',
|
|
2722
|
+
'Alcon Air Optix',
|
|
2723
|
+
'Alcon Aquacomfort',
|
|
2724
|
+
'Alcon Focus',
|
|
2725
|
+
'Alcon Freshlook',
|
|
2726
|
+
'Alcon O2 Optix',
|
|
2727
|
+
'Alcon Precision',
|
|
2728
|
+
'Alcon Total',
|
|
2729
|
+
'All Clean',
|
|
2730
|
+
'Amara',
|
|
2731
|
+
'Amara Color',
|
|
2732
|
+
'Aqua Clear',
|
|
2733
|
+
'Aqua Lens 10H Dailies',
|
|
2734
|
+
'Aqua Soft',
|
|
2735
|
+
'Aquacolor',
|
|
2736
|
+
'Aquacolor Candypack',
|
|
2737
|
+
'Aquacolor Premium',
|
|
2738
|
+
'Aquacolor_Dailies 10LP',
|
|
2739
|
+
'Aquacolor_Monthly 2LP',
|
|
2740
|
+
'Aquacolor_Premium 2LP',
|
|
2741
|
+
'Aqualens',
|
|
2742
|
+
'Aqualens Nxt',
|
|
2743
|
+
'Aqualens_24H 30LP',
|
|
2744
|
+
'Aqualens_24H 6LP',
|
|
2745
|
+
'Aqualens_24H Nxt 3LP',
|
|
2746
|
+
'Aqualens_CandyPack 2LP',
|
|
2747
|
+
'Aqualens_Dailies 10LP',
|
|
2748
|
+
'Aqualens_Dailies 30LP',
|
|
2749
|
+
'Aqualens_Dailies 5LP',
|
|
2750
|
+
'Bausch & Lomb',
|
|
2751
|
+
'Bausch & Lomb Lacelle',
|
|
2752
|
+
'Bausch & Lomb PureVision',
|
|
2753
|
+
'Bausch & Lomb Soflens',
|
|
2754
|
+
'Bausch & Lomb Soflens 59',
|
|
2755
|
+
'Bausch & Lomb iConnect',
|
|
2756
|
+
'Bella',
|
|
2757
|
+
'Biomedic',
|
|
2758
|
+
'Biotrue',
|
|
2759
|
+
'Boss Orange',
|
|
2760
|
+
'British Optics',
|
|
2761
|
+
'Calvin Klein',
|
|
2762
|
+
'Carrera',
|
|
2763
|
+
'Celebration Toric',
|
|
2764
|
+
'Chamelo',
|
|
2765
|
+
'Chhota Bheem',
|
|
2766
|
+
'Ciba Vision',
|
|
2767
|
+
'Clalen Iris',
|
|
2768
|
+
'Colour Perfection',
|
|
2769
|
+
'Cooper Vision',
|
|
2770
|
+
'Cooper Vision Avaira',
|
|
2771
|
+
'Cooper Vision Biofinity',
|
|
2772
|
+
'Diva',
|
|
2773
|
+
'FORM',
|
|
2774
|
+
'Fallon Colby',
|
|
2775
|
+
'Fastrack',
|
|
2776
|
+
'Fossil',
|
|
2777
|
+
'French Connection',
|
|
2778
|
+
'Freshlook',
|
|
2779
|
+
'Hooper',
|
|
2780
|
+
'Hooper Online',
|
|
2781
|
+
'Hooper Screen Glasses',
|
|
2782
|
+
'ICE CUBE',
|
|
2783
|
+
'IDEE',
|
|
2784
|
+
'J&J Define',
|
|
2785
|
+
'John Jacobs',
|
|
2786
|
+
'John Jacobs Computer Glasses',
|
|
2787
|
+
'John Jacobs Online',
|
|
2788
|
+
'John Jacobs Screen Glasses',
|
|
2789
|
+
'John Jacobs TI',
|
|
2790
|
+
'Johnson & Johnson',
|
|
2791
|
+
'LENSKART BLU READERS',
|
|
2792
|
+
'LENSKART PREMIUM READERS',
|
|
2793
|
+
'Le Petit Lunetier',
|
|
2794
|
+
'Lee Cooper',
|
|
2795
|
+
'Lenses Only',
|
|
2796
|
+
'Lenskart',
|
|
2797
|
+
'Lenskart Air',
|
|
2798
|
+
'Lenskart Air LA',
|
|
2799
|
+
'Lenskart Air Online',
|
|
2800
|
+
'Lenskart Air Screen Glasses',
|
|
2801
|
+
'Lenskart BLU Screen Glasses',
|
|
2802
|
+
'Lenskart Boost',
|
|
2803
|
+
'Lenskart Hustlr',
|
|
2804
|
+
'Lenskart Hustlr Screen Glasses',
|
|
2805
|
+
'Lenskart Junior Computer Glasses',
|
|
2806
|
+
'Lenskart PLUS',
|
|
2807
|
+
'Lenskart READERS',
|
|
2808
|
+
'Lenskart STUDIO',
|
|
2809
|
+
'Lenskart Safety Goggles',
|
|
2810
|
+
'Lenskart Studio Online',
|
|
2811
|
+
'Lenskart TOI Special',
|
|
2812
|
+
'Lensme',
|
|
2813
|
+
'Lensspray',
|
|
2814
|
+
'Lewis Hamilton',
|
|
2815
|
+
'Mask',
|
|
2816
|
+
'New Balance',
|
|
2817
|
+
'OJOS',
|
|
2818
|
+
'OWNDAYS',
|
|
2819
|
+
'Oakley',
|
|
2820
|
+
'Opti-Free',
|
|
2821
|
+
'Other Third Party Brands',
|
|
2822
|
+
'Polaroid',
|
|
2823
|
+
'Ray-Ban',
|
|
2824
|
+
'Sunpocket',
|
|
2825
|
+
'Superman',
|
|
2826
|
+
'ThinOptics',
|
|
2827
|
+
'Tom and Jerry',
|
|
2828
|
+
'Tommy Hilfiger',
|
|
2829
|
+
'Velocity',
|
|
2830
|
+
'Vincent Chase',
|
|
2831
|
+
'Vincent Chase Essentials',
|
|
2832
|
+
'Vincent Chase Kids',
|
|
2833
|
+
'Vincent Chase Online',
|
|
2834
|
+
'Vincent Chase Polarized',
|
|
2835
|
+
'Vincent Chase Screen Glasses',
|
|
2836
|
+
'Vintage',
|
|
2837
|
+
'Vogue',
|
|
2838
|
+
];
|
|
2714
2839
|
|
|
2715
|
-
return res.sendSuccess( data
|
|
2840
|
+
return res.sendSuccess( data );
|
|
2716
2841
|
} catch ( error ) {
|
|
2717
2842
|
logger.error( 'getFixtureBrands =>', error );
|
|
2718
2843
|
return res.sendError( 'Internal Server Error', 500 );
|