Skip to content

Commit

Permalink
Feat: dummy asset
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian0701 committed Sep 25, 2024
1 parent fd65ee1 commit d2aae70
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.8.2+13",
"version": "0.8.2+14",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
58 changes: 43 additions & 15 deletions src/components/asset/asset_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,53 @@ import { useTranslation } from 'next-i18next';
import CalendarIcon from '@/components/calendar_icon/calendar_icon';
import { AssetStatus } from '@/constants/asset';

const AssetItem = () => {
const { t } = useTranslation('common');

// ToDo: (20240925 - Julian) dummy data
const acquisitionDate: number = 1632511200;
const assetType: {
interface IAssetItem {
id: number;
acquisitionDate: number;
assetType: {
id: number;
title: string;
} = {
};
assetNumber: string;
assetName: string;
purchasePrice: number;
accumulatedDepreciation: number;
residualValue: number;
remainingTimestamp: number;
assetStatus: AssetStatus;
}

// ToDo: (20240925 - Julian) dummy data
const dummyData: IAssetItem = {
id: 1,
acquisitionDate: 1632511200,
assetType: {
id: 123,
title: 'Machinery',
};
const assetNumber: string = 'A-000010';
const assetName: string = 'MackBook';
const purchasePrice: number = 100000;
const accumulatedDepreciation: number = 5000;
const residualValue: number = 5000;
const remainingTimestamp: number = 1632511200;
const assetStatus: AssetStatus = AssetStatus.NORMAL;
},
assetNumber: 'A-000010',
assetName: 'MackBook',
purchasePrice: 100000,
accumulatedDepreciation: 5000,
residualValue: 5000,
remainingTimestamp: 1761580800,
assetStatus: AssetStatus.NORMAL,
};

const AssetItem = () => {
const { t } = useTranslation('common');

const {
acquisitionDate,
assetType,
assetNumber,
assetName,
purchasePrice,
accumulatedDepreciation,
residualValue,
remainingTimestamp,
assetStatus,
} = dummyData;

// Info: (20240925 - Julian) 取得今天的 0 點的時間戳
const twelveOClockOfToday = new Date().setHours(0, 0, 0, 0) / 1000;
Expand Down

0 comments on commit d2aae70

Please sign in to comment.