@homefile/components-v2 2.24.15 → 2.24.16

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.
Files changed (39) hide show
  1. package/dist/assets/images/logos/default-receipt.png +0 -0
  2. package/dist/assets/images/logos/index.d.ts +2 -1
  3. package/dist/assets/images/logos/index.js +2 -1
  4. package/dist/assets/images/logos/index.ts +2 -0
  5. package/dist/components/receipts/AssignableReceiptCard.d.ts +1 -1
  6. package/dist/components/receipts/AssignableReceiptCard.js +2 -2
  7. package/dist/components/receipts/displayReceipts/GridReceipt.d.ts +1 -1
  8. package/dist/components/receipts/displayReceipts/GridReceipt.js +2 -2
  9. package/dist/components/receipts/displayReceipts/ListReceipt.d.ts +1 -1
  10. package/dist/components/receipts/displayReceipts/ListReceipt.js +2 -2
  11. package/dist/components/receipts/receipt/ReceiptDetails.d.ts +1 -1
  12. package/dist/components/receipts/receipt/ReceiptDetails.js +2 -2
  13. package/dist/components/rooms/GroupCard.js +2 -2
  14. package/dist/helpers/receipts/Receipts.helper.d.ts +2 -2
  15. package/dist/helpers/receipts/Receipts.helper.js +9 -8
  16. package/dist/helpers/rooms/GroupItems.js +3 -3
  17. package/dist/hooks/receipts/useDisplayReceipts.d.ts +1 -1
  18. package/dist/interfaces/homeBoard/FolderDetail.interface.d.ts +2 -2
  19. package/dist/interfaces/receipts/ReceiptCard.interface.d.ts +1 -1
  20. package/dist/interfaces/receipts/receipt/ReceiptDetails.interface.d.ts +1 -2
  21. package/dist/mocks/receipts/Receipts.mock.js +6 -6
  22. package/dist/stories/receipts/displayReceipts/GridReceipt.stories.d.ts +1 -1
  23. package/dist/stories/receipts/displayReceipts/ItemReceipt.stories.d.ts +1 -1
  24. package/dist/stories/receipts/displayReceipts/ListReceipt.stories.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/src/assets/images/logos/default-receipt.png +0 -0
  27. package/src/assets/images/logos/index.ts +2 -0
  28. package/src/components/receipts/AssignableReceiptCard.tsx +3 -3
  29. package/src/components/receipts/autofiler/AutofilerBubble.tsx +1 -2
  30. package/src/components/receipts/displayReceipts/GridReceipt.tsx +2 -2
  31. package/src/components/receipts/displayReceipts/ListReceipt.tsx +2 -2
  32. package/src/components/receipts/receipt/ReceiptDetails.tsx +2 -2
  33. package/src/components/rooms/GroupCard.tsx +2 -2
  34. package/src/helpers/receipts/Receipts.helper.ts +11 -10
  35. package/src/helpers/rooms/GroupItems.ts +3 -3
  36. package/src/interfaces/homeBoard/FolderDetail.interface.ts +1 -2
  37. package/src/interfaces/receipts/ReceiptCard.interface.ts +1 -1
  38. package/src/interfaces/receipts/receipt/ReceiptDetails.interface.ts +1 -9
  39. package/src/mocks/receipts/Receipts.mock.ts +6 -6
@@ -1,4 +1,5 @@
1
1
  import APHW from './aphw.png';
2
+ import DefaultReceipt from './default-receipt.png';
2
3
  import HomeDepot from './home-depot.png';
3
4
  import Homefile from './homefile.png';
4
5
  import Lowes from './lowes.png';
@@ -7,4 +8,4 @@ import Prime from './prime.png';
7
8
  import Sears from './sears.png';
8
9
  import Shine from './shine.png';
9
10
  import Terminix from './terminix.png';
10
- export { APHW, HomeDepot, Homefile, Lowes, Walmart, Prime, Sears, Shine, Terminix, };
11
+ export { APHW, DefaultReceipt, HomeDepot, Homefile, Lowes, Walmart, Prime, Sears, Shine, Terminix, };
@@ -1,4 +1,5 @@
1
1
  import APHW from './aphw.png';
2
+ import DefaultReceipt from './default-receipt.png';
2
3
  import HomeDepot from './home-depot.png';
3
4
  import Homefile from './homefile.png';
4
5
  import Lowes from './lowes.png';
@@ -7,4 +8,4 @@ import Prime from './prime.png';
7
8
  import Sears from './sears.png';
8
9
  import Shine from './shine.png';
9
10
  import Terminix from './terminix.png';
10
- export { APHW, HomeDepot, Homefile, Lowes, Walmart, Prime, Sears, Shine, Terminix, };
11
+ export { APHW, DefaultReceipt, HomeDepot, Homefile, Lowes, Walmart, Prime, Sears, Shine, Terminix, };
@@ -1,4 +1,5 @@
1
1
  import APHW from './aphw.png'
2
+ import DefaultReceipt from './default-receipt.png'
2
3
  import HomeDepot from './home-depot.png'
3
4
  import Homefile from './homefile.png'
4
5
  import Lowes from './lowes.png'
@@ -10,6 +11,7 @@ import Terminix from './terminix.png'
10
11
 
11
12
  export {
12
13
  APHW,
14
+ DefaultReceipt,
13
15
  HomeDepot,
14
16
  Homefile,
15
17
  Lowes,
@@ -1,2 +1,2 @@
1
1
  import { AssignableReceiptCardI } from '../../interfaces';
2
- export declare const AssignableReceiptCard: ({ isChecked, itemQuantity, onChange, purchaseDate, receiptOrigin, total, }: AssignableReceiptCardI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const AssignableReceiptCard: ({ isChecked, itemQuantity, onChange, purchaseDate, origin, total, }: AssignableReceiptCardI) => import("react/jsx-runtime").JSX.Element;
@@ -3,11 +3,11 @@ import { t } from 'i18next';
3
3
  import { Checkbox, Flex, Stack, Image, Text } from '@chakra-ui/react';
4
4
  import { receiptOrigins } from '../../helpers';
5
5
  import { formatCurrency, formatDateWithAt } from '../../utils';
6
- export const AssignableReceiptCard = ({ isChecked, itemQuantity = 1, onChange, purchaseDate = new Date(), receiptOrigin = 'homeDepot', total = '0', }) => {
6
+ export const AssignableReceiptCard = ({ isChecked, itemQuantity = 1, onChange, purchaseDate = new Date(), origin = '', total = '0', }) => {
7
7
  const date = formatDateWithAt({ date: purchaseDate });
8
8
  const totalFormatted = formatCurrency({ value: total });
9
9
  const totalItems = itemQuantity > 1
10
10
  ? `${itemQuantity} ${t('receipts.items')}`
11
11
  : `${itemQuantity} ${t('receipts.item')}`;
12
- return (_jsxs(Flex, { bg: "lightBlue.2", gap: "4", borderTop: "1px solid", borderColor: "lightBlue.2", children: [_jsx(Checkbox, { isChecked: isChecked, onChange: onChange }), _jsx(Stack, { w: "100%", p: "base", bg: isChecked ? 'lightGreen.1' : 'neutral.white', spacing: "1", children: _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Image, { src: receiptOrigins[receiptOrigin], w: "auto", h: ["40px", "69px"], fit: "contain" }), _jsxs(Stack, { w: "100%", spacing: "1", children: [_jsx(Text, { fontSize: "xxs", children: date }), _jsx(Text, { textTransform: "capitalize", children: `${receiptOrigin} ${t('receipts.receipt')}` }), _jsxs(Flex, { align: "baseline", justify: "flex-end", gap: "4", children: [_jsx(Text, { fontSize: "xs", fontFamily: "secondary", textTransform: "uppercase", children: totalItems }), _jsx(Text, { children: totalFormatted })] })] })] }) })] }));
12
+ return (_jsxs(Flex, { bg: "lightBlue.2", gap: "4", borderTop: "1px solid", borderColor: "lightBlue.2", children: [_jsx(Checkbox, { isChecked: isChecked, onChange: onChange }), _jsx(Stack, { w: "100%", p: "base", bg: isChecked ? 'lightGreen.1' : 'neutral.white', spacing: "1", children: _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Image, { src: receiptOrigins[origin], w: "auto", h: ["40px", "69px"], fit: "contain" }), _jsxs(Stack, { w: "100%", spacing: "1", children: [_jsx(Text, { fontSize: "xxs", children: date }), _jsx(Text, { textTransform: "capitalize", children: `${origin} ${t('receipts.receipt')}` }), _jsxs(Flex, { align: "baseline", justify: "flex-end", gap: "4", children: [_jsx(Text, { fontSize: "xs", fontFamily: "secondary", textTransform: "uppercase", children: totalItems }), _jsx(Text, { children: totalFormatted })] })] })] }) })] }));
13
13
  };
@@ -1,2 +1,2 @@
1
1
  import { ReceiptI } from '../../../interfaces';
2
- export declare const GridReceipt: ({ assignStatus, _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin, total, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const GridReceipt: ({ assignStatus, _id, itemQuantity, menuItems, onClick, purchaseDate, origin, total, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
@@ -5,8 +5,8 @@ import { ReceiptBg } from '../../../assets/images';
5
5
  import { IconMenu, MoreHorizontal, TextBadge } from '../..';
6
6
  import { receiptOrigins } from '../../../helpers';
7
7
  import { formatDateTime } from '../../../utils';
8
- export const GridReceipt = ({ assignStatus = 'unfiled', _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin = 'homeDepot', total, name }) => {
9
- const storeImage = receiptOrigins[receiptOrigin];
8
+ export const GridReceipt = ({ assignStatus = 'unfiled', _id, itemQuantity, menuItems, onClick, purchaseDate, origin = '', total, name }) => {
9
+ const storeImage = receiptOrigins[origin];
10
10
  const handleClick = () => onClick(_id);
11
11
  const { formattedDate: date, formattedTime: time } = formatDateTime({
12
12
  date: purchaseDate,
@@ -1,2 +1,2 @@
1
1
  import { ReceiptI } from '../../../interfaces';
2
- export declare const ListReceipt: ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ListReceipt: ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, origin, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,8 @@ import { Box, Flex, Img, Stack, Text } from '@chakra-ui/react';
4
4
  import { IconMenu, MoreHorizontal } from '../..';
5
5
  import { receiptOrigins } from '../../../helpers';
6
6
  import { formatDateTime } from '../../../utils';
7
- export const ListReceipt = ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin = 'homeDepot', name }) => {
8
- const storeImage = receiptOrigins[receiptOrigin];
7
+ export const ListReceipt = ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, origin = '', name }) => {
8
+ const storeImage = receiptOrigins[origin];
9
9
  const handleClick = () => onClick(_id);
10
10
  const { formattedDate: date, formattedTime: time } = formatDateTime({
11
11
  date: purchaseDate,
@@ -1,4 +1,4 @@
1
1
  import { ReceiptDetailsDBI } from '../../../interfaces';
2
- export declare const ReceiptDetails: ({ name, cashier, itemQuantity, paymentMethod, purchaseDate, tax, store, receiptOrigin, storePhone, total, onEdit, }: Partial<ReceiptDetailsDBI> & {
2
+ export declare const ReceiptDetails: ({ name, cashier, itemQuantity, paymentMethod, purchaseDate, tax, store, origin, storePhone, total, onEdit, }: Partial<ReceiptDetailsDBI> & {
3
3
  onEdit?: () => void;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,8 @@ import { Box, Divider, Flex, IconButton, Image, Text } from '@chakra-ui/react';
4
4
  import { formatDate } from '../../../utils';
5
5
  import { DetailsColumn, Edit } from '../..';
6
6
  import { receiptOrigins } from '../../../helpers';
7
- export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod, purchaseDate, tax, store, receiptOrigin = 'homeDepot', storePhone = '', total, onEdit, }) => {
8
- const storeImage = receiptOrigins[receiptOrigin];
7
+ export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod, purchaseDate, tax, store, origin = "", storePhone = '', total, onEdit, }) => {
8
+ const storeImage = receiptOrigins[origin];
9
9
  const leftLabels = t('receipts.columnLeft').split(',');
10
10
  const rightLabels = t('receipts.columnRight').split(',');
11
11
  const leftColumn = [
@@ -35,8 +35,8 @@ export const GroupCard = (_a) => {
35
35
  : ((_a = report === null || report === void 0 ? void 0 : report.find((doc) => { var _a; return (_a = doc === null || doc === void 0 ? void 0 : doc.name) === null || _a === void 0 ? void 0 : _a.includes('Brand'); })) === null || _a === void 0 ? void 0 : _a.value) || '';
36
36
  const hasImage = images.length > 0;
37
37
  const imageUrl = `${storageUrl}/${(_b = images[0]) === null || _b === void 0 ? void 0 : _b.bucketName}/${(_c = images[0]) === null || _c === void 0 ? void 0 : _c.fileName}.${(_d = images[0]) === null || _d === void 0 ? void 0 : _d.extension}`;
38
- const storeImage = (metadata === null || metadata === void 0 ? void 0 : metadata.receiptOrigin)
39
- ? receiptOrigins[metadata === null || metadata === void 0 ? void 0 : metadata.receiptOrigin]
38
+ const storeImage = (metadata === null || metadata === void 0 ? void 0 : metadata.origin)
39
+ ? receiptOrigins[metadata === null || metadata === void 0 ? void 0 : metadata.origin]
40
40
  : '';
41
41
  const handleImage = (files) => {
42
42
  if (files) {
@@ -1,3 +1,3 @@
1
- import { ReceiptCardItemI, ReceiptOrigintProps } from '../../interfaces';
2
- export declare const receiptOrigins: Record<ReceiptOrigintProps, string>;
1
+ import { ReceiptCardItemI } from '../../interfaces';
2
+ export declare const receiptOrigins: Record<string, string>;
3
3
  export declare const receipts: ReceiptCardItemI[];
@@ -1,53 +1,54 @@
1
- import { HomeDepot, Lowes, Walmart } from '../../assets/images';
1
+ import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '../../assets/images';
2
2
  export const receiptOrigins = {
3
3
  homeDepot: HomeDepot,
4
4
  HomeDepot: HomeDepot,
5
5
  lowes: Lowes,
6
6
  Lowes: Lowes,
7
7
  walmart: Walmart,
8
- Walmart: Walmart
8
+ Walmart: Walmart,
9
+ "": DefaultReceipt
9
10
  };
10
11
  export const receipts = [
11
12
  {
12
13
  purchaseDate: new Date(),
13
14
  total: '100',
14
15
  itemQuantity: 1,
15
- receiptOrigin: 'homeDepot',
16
+ origin: 'homeDepot',
16
17
  _id: "1"
17
18
  },
18
19
  {
19
20
  purchaseDate: new Date(),
20
21
  total: '110',
21
22
  itemQuantity: 3,
22
- receiptOrigin: 'lowes',
23
+ origin: 'lowes',
23
24
  _id: "2"
24
25
  },
25
26
  {
26
27
  purchaseDate: new Date(),
27
28
  total: '120',
28
29
  itemQuantity: 1,
29
- receiptOrigin: 'homeDepot',
30
+ origin: 'homeDepot',
30
31
  _id: "3"
31
32
  },
32
33
  {
33
34
  purchaseDate: new Date(),
34
35
  total: '100',
35
36
  itemQuantity: 1,
36
- receiptOrigin: 'lowes',
37
+ origin: 'lowes',
37
38
  _id: "4"
38
39
  },
39
40
  {
40
41
  purchaseDate: new Date(),
41
42
  total: '100',
42
43
  itemQuantity: 2,
43
- receiptOrigin: 'homeDepot',
44
+ origin: 'homeDepot',
44
45
  _id: "5"
45
46
  },
46
47
  {
47
48
  purchaseDate: new Date(),
48
49
  total: '100',
49
50
  itemQuantity: 1,
50
- receiptOrigin: 'lowes',
51
+ origin: 'lowes',
51
52
  _id: "6"
52
53
  },
53
54
  ];
@@ -91,7 +91,7 @@ export const PaintItems = [
91
91
  type: 'File',
92
92
  subType: 'image',
93
93
  metadata: {
94
- receiptOrigin: 'homeDepot',
94
+ origin: 'homeDepot',
95
95
  },
96
96
  needsReview: false,
97
97
  reviewed: false,
@@ -223,7 +223,7 @@ export const PaintItems = [
223
223
  type: 'File',
224
224
  subType: 'image',
225
225
  metadata: {
226
- receiptOrigin: 'homeDepot',
226
+ origin: 'homeDepot',
227
227
  },
228
228
  needsReview: false,
229
229
  reviewed: false,
@@ -347,7 +347,7 @@ export const PaintItems = [
347
347
  type: 'Construction',
348
348
  subType: 'image',
349
349
  metadata: {
350
- receiptOrigin: 'lowes',
350
+ origin: 'lowes',
351
351
  },
352
352
  needsReview: false,
353
353
  reviewed: false,
@@ -16,7 +16,7 @@ export declare const useDisplayReceipts: ({ receipts }: UseDisplayReceiptsI) =>
16
16
  paymentMethod: string;
17
17
  purchaseDate?: Date;
18
18
  receiptImage?: string;
19
- receiptOrigin?: import("../../interfaces").ReceiptOrigintProps;
19
+ origin?: string;
20
20
  store: string;
21
21
  storeNumber?: string;
22
22
  storePhone?: string;
@@ -1,4 +1,4 @@
1
- import { FileI, FolderI, ImageDBI, SelectItemI, AssociatedAccountI, RoomItemI, FileInfoI, ReceiptOrigintProps, ReportI } from '..';
1
+ import { FileI, FolderI, ImageDBI, SelectItemI, AssociatedAccountI, RoomItemI, FileInfoI, ReportI } from '..';
2
2
  import { ReactNode } from 'react';
3
3
  export interface FolderDetailI {
4
4
  addedBy: string;
@@ -46,7 +46,7 @@ export interface UploadFileI extends FileInfoI {
46
46
  file?: File | FileDBI;
47
47
  }
48
48
  export interface ReportMetadataI {
49
- receiptOrigin?: ReceiptOrigintProps;
49
+ origin: string;
50
50
  }
51
51
  export interface ReportsI {
52
52
  __v: number;
@@ -3,7 +3,7 @@ export interface ReceiptCardItemI {
3
3
  _id: string;
4
4
  itemQuantity?: number;
5
5
  purchaseDate?: Date;
6
- receiptOrigin?: 'homeDepot' | 'lowes';
6
+ origin?: string;
7
7
  total?: string;
8
8
  }
9
9
  export interface ReceiptCardI extends ReceiptCardItemI {
@@ -2,7 +2,6 @@ export type ColumnDetailsType = {
2
2
  label: string;
3
3
  value: string | number | Date;
4
4
  };
5
- export type ReceiptOrigintProps = 'homeDepot' | 'lowes' | 'HomeDepot' | 'Lowes' | 'walmart' | 'Walmart';
6
5
  export type ReceiptAssignStatusProps = 'filed' | 'filing' | 'unfiled';
7
6
  export interface ItemsI {
8
7
  _id: string;
@@ -20,7 +19,7 @@ export interface ReceiptDetailsDBI {
20
19
  paymentMethod: string;
21
20
  purchaseDate?: Date;
22
21
  receiptImage?: string;
23
- receiptOrigin?: ReceiptOrigintProps;
22
+ origin?: string;
24
23
  store: string;
25
24
  storeNumber?: string;
26
25
  storePhone?: string;
@@ -10,7 +10,7 @@ export const receiptsReceivedMock = [
10
10
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
11
11
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
12
12
  store: '',
13
- receiptOrigin: 'homeDepot',
13
+ origin: 'homeDepot',
14
14
  storePhone: faker.phone.number(),
15
15
  total: faker.finance.amount({ min: 1, max: 100 }),
16
16
  },
@@ -24,7 +24,7 @@ export const receiptsReceivedMock = [
24
24
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
25
25
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
26
26
  store: faker.company.name(),
27
- receiptOrigin: 'lowes',
27
+ origin: 'lowes',
28
28
  storePhone: faker.phone.number(),
29
29
  total: faker.finance.amount({ min: 1, max: 100 }),
30
30
  },
@@ -37,7 +37,7 @@ export const receiptsReceivedMock = [
37
37
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
38
38
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
39
39
  store: faker.company.name(),
40
- receiptOrigin: 'lowes',
40
+ origin: 'lowes',
41
41
  storePhone: faker.phone.number(),
42
42
  total: faker.finance.amount({ min: 1, max: 100 }),
43
43
  },
@@ -50,7 +50,7 @@ export const receiptsReceivedMock = [
50
50
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
51
51
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
52
52
  store: faker.company.name(),
53
- receiptOrigin: 'homeDepot',
53
+ origin: 'homeDepot',
54
54
  storePhone: faker.phone.number(),
55
55
  total: faker.finance.amount({ min: 1, max: 100 }),
56
56
  },
@@ -63,7 +63,7 @@ export const receiptsReceivedMock = [
63
63
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
64
64
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
65
65
  store: faker.company.name(),
66
- receiptOrigin: 'homeDepot',
66
+ origin: 'homeDepot',
67
67
  storePhone: faker.phone.number(),
68
68
  total: faker.finance.amount({ min: 1, max: 100 }),
69
69
  },
@@ -76,7 +76,7 @@ export const receiptsReceivedMock = [
76
76
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
77
77
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
78
78
  store: faker.company.name(),
79
- receiptOrigin: 'lowes',
79
+ origin: 'lowes',
80
80
  storePhone: faker.phone.number(),
81
81
  total: faker.finance.amount({ min: 1, max: 100 }),
82
82
  },
@@ -16,7 +16,7 @@ export declare const GridReceiptComponent: {
16
16
  paymentMethod: string;
17
17
  purchaseDate?: Date;
18
18
  receiptImage?: string;
19
- receiptOrigin?: import("../../../interfaces").ReceiptOrigintProps;
19
+ origin?: string;
20
20
  store: string;
21
21
  storeNumber?: string;
22
22
  storePhone?: string;
@@ -16,7 +16,7 @@ export declare const ItemReceiptComponent: {
16
16
  paymentMethod: string;
17
17
  purchaseDate?: Date;
18
18
  receiptImage?: string;
19
- receiptOrigin?: import("../../../interfaces").ReceiptOrigintProps;
19
+ origin?: string;
20
20
  store: string;
21
21
  storeNumber?: string;
22
22
  storePhone?: string;
@@ -16,7 +16,7 @@ export declare const ListReceiptComponent: {
16
16
  paymentMethod: string;
17
17
  purchaseDate?: Date;
18
18
  receiptImage?: string;
19
- receiptOrigin?: import("../../../interfaces").ReceiptOrigintProps;
19
+ origin?: string;
20
20
  store: string;
21
21
  storeNumber?: string;
22
22
  storePhone?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.24.15",
3
+ "version": "2.24.16",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  import APHW from './aphw.png'
2
+ import DefaultReceipt from './default-receipt.png'
2
3
  import HomeDepot from './home-depot.png'
3
4
  import Homefile from './homefile.png'
4
5
  import Lowes from './lowes.png'
@@ -10,6 +11,7 @@ import Terminix from './terminix.png'
10
11
 
11
12
  export {
12
13
  APHW,
14
+ DefaultReceipt,
13
15
  HomeDepot,
14
16
  Homefile,
15
17
  Lowes,
@@ -9,7 +9,7 @@ export const AssignableReceiptCard = ({
9
9
  itemQuantity = 1,
10
10
  onChange,
11
11
  purchaseDate = new Date(),
12
- receiptOrigin = 'homeDepot',
12
+ origin = '',
13
13
  total = '0',
14
14
  }: AssignableReceiptCardI) => {
15
15
  const date = formatDateWithAt({ date: purchaseDate })
@@ -34,14 +34,14 @@ export const AssignableReceiptCard = ({
34
34
  >
35
35
  <Flex align="center" gap="base">
36
36
  <Image
37
- src={receiptOrigins[receiptOrigin]}
37
+ src={receiptOrigins[origin]}
38
38
  w="auto"
39
39
  h={["40px","69px"]}
40
40
  fit="contain"
41
41
  />
42
42
  <Stack w="100%" spacing="1">
43
43
  <Text fontSize="xxs">{date}</Text>
44
- <Text textTransform="capitalize">{`${receiptOrigin} ${t(
44
+ <Text textTransform="capitalize">{`${origin} ${t(
45
45
  'receipts.receipt'
46
46
  )}`}</Text>
47
47
  <Flex align="baseline" justify="flex-end" gap="4">
@@ -2,10 +2,9 @@ import { t } from 'i18next'
2
2
  import { Stack, Box, Flex, Text, Image } from '@chakra-ui/react'
3
3
  import { BubbleText } from '@/components'
4
4
  import { receiptOrigins } from '@/helpers'
5
- import { ReceiptOrigintProps } from '@/interfaces'
6
5
 
7
6
  export const AutofilerBubble = () => {
8
- const retails: ReceiptOrigintProps[] = ['homeDepot', 'lowes', 'walmart']
7
+ const retails: string[] = ['homeDepot', 'lowes', 'walmart']
9
8
  return (
10
9
  <Stack spacing="4" pb="4">
11
10
  <BubbleText
@@ -13,11 +13,11 @@ export const GridReceipt = ({
13
13
  menuItems,
14
14
  onClick,
15
15
  purchaseDate,
16
- receiptOrigin = 'homeDepot',
16
+ origin = '',
17
17
  total,
18
18
  name
19
19
  }: ReceiptI) => {
20
- const storeImage = receiptOrigins[receiptOrigin]
20
+ const storeImage = receiptOrigins[origin]
21
21
 
22
22
  const handleClick = () => onClick(_id)
23
23
 
@@ -13,10 +13,10 @@ export const ListReceipt = ({
13
13
  store,
14
14
  itemQuantity,
15
15
  purchaseDate,
16
- receiptOrigin = 'homeDepot',
16
+ origin = '',
17
17
  name
18
18
  }: ReceiptI) => {
19
- const storeImage = receiptOrigins[receiptOrigin]
19
+ const storeImage = receiptOrigins[origin]
20
20
  const handleClick = () => onClick(_id)
21
21
  const { formattedDate: date, formattedTime: time } = formatDateTime({
22
22
  date: purchaseDate,
@@ -13,12 +13,12 @@ export const ReceiptDetails = ({
13
13
  purchaseDate,
14
14
  tax,
15
15
  store,
16
- receiptOrigin = 'homeDepot',
16
+ origin = "",
17
17
  storePhone = '',
18
18
  total,
19
19
  onEdit,
20
20
  }: Partial<ReceiptDetailsDBI> & { onEdit?: () => void }) => {
21
- const storeImage = receiptOrigins[receiptOrigin]
21
+ const storeImage = receiptOrigins[origin]
22
22
  const leftLabels = t('receipts.columnLeft').split(',')
23
23
  const rightLabels = t('receipts.columnRight').split(',')
24
24
  const leftColumn: Partial<ColumnDetailsType>[] = [
@@ -96,8 +96,8 @@ export const GroupCard = ({
96
96
 
97
97
  const imageUrl = `${storageUrl}/${images[0]?.bucketName}/${images[0]?.fileName}.${images[0]?.extension}`
98
98
 
99
- const storeImage = metadata?.receiptOrigin
100
- ? receiptOrigins[metadata?.receiptOrigin]
99
+ const storeImage = metadata?.origin
100
+ ? receiptOrigins[metadata?.origin]
101
101
  : ''
102
102
 
103
103
  const handleImage = (files: File[] | any) => {
@@ -1,13 +1,14 @@
1
- import { ReceiptCardItemI, ReceiptOrigintProps } from '@/interfaces'
2
- import { HomeDepot, Lowes, Walmart } from '@/assets/images'
1
+ import { ReceiptCardItemI } from '@/interfaces'
2
+ import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '@/assets/images'
3
3
 
4
- export const receiptOrigins: Record<ReceiptOrigintProps, string> = {
4
+ export const receiptOrigins: Record<string, string> = {
5
5
  homeDepot: HomeDepot,
6
6
  HomeDepot: HomeDepot,
7
7
  lowes: Lowes,
8
8
  Lowes: Lowes,
9
9
  walmart: Walmart,
10
- Walmart: Walmart
10
+ Walmart: Walmart,
11
+ "" : DefaultReceipt
11
12
  }
12
13
 
13
14
  export const receipts: ReceiptCardItemI[] = [
@@ -15,42 +16,42 @@ export const receipts: ReceiptCardItemI[] = [
15
16
  purchaseDate: new Date(),
16
17
  total: '100',
17
18
  itemQuantity: 1,
18
- receiptOrigin: 'homeDepot',
19
+ origin: 'homeDepot',
19
20
  _id: "1"
20
21
  },
21
22
  {
22
23
  purchaseDate: new Date(),
23
24
  total: '110',
24
25
  itemQuantity: 3,
25
- receiptOrigin: 'lowes',
26
+ origin: 'lowes',
26
27
  _id: "2"
27
28
  },
28
29
  {
29
30
  purchaseDate: new Date(),
30
31
  total: '120',
31
32
  itemQuantity: 1,
32
- receiptOrigin: 'homeDepot',
33
+ origin: 'homeDepot',
33
34
  _id: "3"
34
35
  },
35
36
  {
36
37
  purchaseDate: new Date(),
37
38
  total: '100',
38
39
  itemQuantity: 1,
39
- receiptOrigin: 'lowes',
40
+ origin: 'lowes',
40
41
  _id: "4"
41
42
  },
42
43
  {
43
44
  purchaseDate: new Date(),
44
45
  total: '100',
45
46
  itemQuantity: 2,
46
- receiptOrigin: 'homeDepot',
47
+ origin: 'homeDepot',
47
48
  _id: "5"
48
49
  },
49
50
  {
50
51
  purchaseDate: new Date(),
51
52
  total: '100',
52
53
  itemQuantity: 1,
53
- receiptOrigin: 'lowes',
54
+ origin: 'lowes',
54
55
  _id: "6"
55
56
  },
56
57
  ]
@@ -93,7 +93,7 @@ export const PaintItems: ReportsI[] = [
93
93
  type: 'File',
94
94
  subType: 'image',
95
95
  metadata: {
96
- receiptOrigin: 'homeDepot',
96
+ origin: 'homeDepot',
97
97
  },
98
98
  needsReview: false,
99
99
  reviewed: false,
@@ -225,7 +225,7 @@ export const PaintItems: ReportsI[] = [
225
225
  type: 'File',
226
226
  subType: 'image',
227
227
  metadata: {
228
- receiptOrigin: 'homeDepot',
228
+ origin: 'homeDepot',
229
229
  },
230
230
  needsReview: false,
231
231
  reviewed: false,
@@ -349,7 +349,7 @@ export const PaintItems: ReportsI[] = [
349
349
  type: 'Construction',
350
350
  subType: 'image',
351
351
  metadata: {
352
- receiptOrigin: 'lowes',
352
+ origin: 'lowes',
353
353
  },
354
354
  needsReview: false,
355
355
  reviewed: false,
@@ -6,7 +6,6 @@ import {
6
6
  AssociatedAccountI,
7
7
  RoomItemI,
8
8
  FileInfoI,
9
- ReceiptOrigintProps,
10
9
  ReportI
11
10
  } from '@/interfaces'
12
11
  import { ReactNode } from 'react'
@@ -60,7 +59,7 @@ export interface UploadFileI extends FileInfoI {
60
59
  }
61
60
 
62
61
  export interface ReportMetadataI {
63
- receiptOrigin?: ReceiptOrigintProps
62
+ origin: string
64
63
  }
65
64
 
66
65
  export interface ReportsI {
@@ -4,7 +4,7 @@ export interface ReceiptCardItemI {
4
4
  _id: string
5
5
  itemQuantity?: number
6
6
  purchaseDate?: Date
7
- receiptOrigin?: 'homeDepot' | 'lowes'
7
+ origin?: string
8
8
  total?: string
9
9
  }
10
10
 
@@ -3,14 +3,6 @@ export type ColumnDetailsType = {
3
3
  value: string | number | Date
4
4
  }
5
5
 
6
- export type ReceiptOrigintProps =
7
- | 'homeDepot'
8
- | 'lowes'
9
- | 'HomeDepot'
10
- | 'Lowes'
11
- | 'walmart'
12
- | 'Walmart'
13
-
14
6
  export type ReceiptAssignStatusProps = 'filed' | 'filing' | 'unfiled'
15
7
 
16
8
  export interface ItemsI {
@@ -30,7 +22,7 @@ export interface ReceiptDetailsDBI {
30
22
  paymentMethod: string
31
23
  purchaseDate?: Date
32
24
  receiptImage?: string
33
- receiptOrigin?: ReceiptOrigintProps
25
+ origin?: string
34
26
  store: string
35
27
  storeNumber?: string
36
28
  storePhone?: string
@@ -12,7 +12,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
12
12
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
13
13
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
14
14
  store: '',
15
- receiptOrigin: 'homeDepot',
15
+ origin: 'homeDepot',
16
16
  storePhone: faker.phone.number(),
17
17
  total: faker.finance.amount({ min: 1, max: 100 }),
18
18
  },
@@ -26,7 +26,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
26
26
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
27
27
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
28
28
  store: faker.company.name(),
29
- receiptOrigin: 'lowes',
29
+ origin: 'lowes',
30
30
  storePhone: faker.phone.number(),
31
31
  total: faker.finance.amount({ min: 1, max: 100 }),
32
32
  },
@@ -39,7 +39,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
39
39
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
40
40
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
41
41
  store: faker.company.name(),
42
- receiptOrigin: 'lowes',
42
+ origin: 'lowes',
43
43
  storePhone: faker.phone.number(),
44
44
  total: faker.finance.amount({ min: 1, max: 100 }),
45
45
  },
@@ -52,7 +52,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
52
52
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
53
53
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
54
54
  store: faker.company.name(),
55
- receiptOrigin: 'homeDepot',
55
+ origin: 'homeDepot',
56
56
  storePhone: faker.phone.number(),
57
57
  total: faker.finance.amount({ min: 1, max: 100 }),
58
58
  },
@@ -65,7 +65,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
65
65
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
66
66
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
67
67
  store: faker.company.name(),
68
- receiptOrigin: 'homeDepot',
68
+ origin: 'homeDepot',
69
69
  storePhone: faker.phone.number(),
70
70
  total: faker.finance.amount({ min: 1, max: 100 }),
71
71
  },
@@ -78,7 +78,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
78
78
  receiptImage: faker.image.urlPicsumPhotos({ width: 500, height: 500 }),
79
79
  tax: faker.number.int({ min: 1, max: 3 }).toString(),
80
80
  store: faker.company.name(),
81
- receiptOrigin: 'lowes',
81
+ origin: 'lowes',
82
82
  storePhone: faker.phone.number(),
83
83
  total: faker.finance.amount({ min: 1, max: 100 }),
84
84
  },