tango-app-api-trax 3.7.59 → 3.7.60

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.7.59",
3
+ "version": "3.7.60",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -3267,7 +3267,6 @@ export async function getStoreTaskDetails( req, res ) {
3267
3267
  storeName: req.body.storeName,
3268
3268
  isPlano: true,
3269
3269
  planoType: { $in: [ 'fixture', 'merchRollout', 'vmRollout' ] },
3270
- scheduleEndTime_iso: { $gte: new Date( dayjs().format( 'YYYY-MM-DD' ) ) },
3271
3270
  },
3272
3271
  },
3273
3272
  {
@@ -3302,7 +3301,7 @@ export async function getStoreTaskDetails( req, res ) {
3302
3301
 
3303
3302
  let result = {
3304
3303
  storeId: req.body.storeName,
3305
- tangoPosBlocks: info.filter( ( ele ) => ele.checklistStatus == 'submit' ).map( ( ele ) => {
3304
+ tangoPosBlocks: info.filter( ( ele ) => ele.checklistStatus != 'submit' && dayjs( ele?.scheduleEndTime_iso ).format( 'YYYY-MM-DD' ) < dayjs().format( 'YYYY-MM-DD' ) ).map( ( ele ) => {
3306
3305
  return {
3307
3306
  blockName: ele?.checkListName,
3308
3307
  blockEnabled: true,
@@ -29,11 +29,11 @@ import * as cameraService from '../services/camera.service.js';
29
29
  dayjs.extend( isSameOrBefore );
30
30
  import * as pdf from 'html-pdf';
31
31
  import handlebars from './handlebar-helper.js';
32
- import fs from 'fs';
33
- import { fileURLToPath } from 'url';
34
- import path from 'path';
35
- const __filename = fileURLToPath( import.meta.url );
36
- const __dirname = path.dirname( __filename );
32
+ // import fs from 'fs';
33
+ // import { fileURLToPath } from 'url';
34
+ // import path from 'path';
35
+ // const __filename = fileURLToPath( import.meta.url );
36
+ // const __dirname = path.dirname( __filename );
37
37
 
38
38
  export async function storeList( req, res ) {
39
39
  try {
@@ -2026,9 +2026,9 @@ export async function submitChecklist( req, res ) {
2026
2026
  time: updateData.submitMobileTime,
2027
2027
  domain: JSON.parse( process.env.URL ).domain,
2028
2028
  };
2029
- const templateHtml = fs.readFileSync( path.resolve( path.dirname( '' ) ) + '/src/hbs/trialExtentionEmail.hbs', 'utf8' );
2030
- const template = Handlebars.compile( templateHtml );
2031
- const html = template( { data: data } );
2029
+ const fileContent = readFileSync( join() + '/src/hbs/flag.hbs', 'utf8' );
2030
+ const htmlContent = handlebars.compile( fileContent );
2031
+ const html = htmlContent( { data: data } );
2032
2032
  emailList.forEach( ( email ) => {
2033
2033
  let params = {
2034
2034
  toEmail: email,
@@ -4617,8 +4617,7 @@ export async function downloadChecklist( req, res ) {
4617
4617
  } );
4618
4618
  } );
4619
4619
  } );
4620
- const targetFolder = path.join( __dirname, '..', '/hbs/template.hbs' );
4621
- const templateHtml = fs.readFileSync( targetFolder, 'utf8' );
4620
+ const templateHtml = readFileSync( join() + '/src/hbs/template.hbs', 'utf8' );
4622
4621
  const template = handlebars.compile( templateHtml );
4623
4622
  const html = template( { data: checklistDetails } );
4624
4623
  pdf.create( html ).toBuffer( ( err, buffer ) => {
@@ -4636,24 +4635,24 @@ export async function downloadChecklist( req, res ) {
4636
4635
  }
4637
4636
  }
4638
4637
 
4639
- async function convertUrltoBase64( url ) {
4640
- try {
4641
- const response = await fetch( url );
4638
+ // async function convertUrltoBase64( url ) {
4639
+ // try {
4640
+ // const response = await fetch( url );
4642
4641
 
4643
- if ( !response.ok ) {
4644
- throw new Error( 'Failed to fetch image' );
4645
- }
4642
+ // if ( !response.ok ) {
4643
+ // throw new Error( 'Failed to fetch image' );
4644
+ // }
4646
4645
 
4647
- const contentType = response.headers.get( 'content-type' );
4648
- const arrayBuffer = await response.arrayBuffer();
4646
+ // const contentType = response.headers.get( 'content-type' );
4647
+ // const arrayBuffer = await response.arrayBuffer();
4649
4648
 
4650
- const base64Image =
4651
- `data:${contentType};base64,` +
4652
- Buffer.from( arrayBuffer ).toString( 'base64' );
4649
+ // const base64Image =
4650
+ // `data:${contentType};base64,` +
4651
+ // Buffer.from( arrayBuffer ).toString( 'base64' );
4653
4652
 
4654
- return base64Image;
4655
- } catch ( error ) {
4656
- // console.error( 'Error fetching image:', error.message );
4657
- return false;
4658
- }
4659
- }
4653
+ // return base64Image;
4654
+ // } catch ( error ) {
4655
+ // // console.error( 'Error fetching image:', error.message );
4656
+ // return false;
4657
+ // }
4658
+ // }