Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setting related mock up #2652

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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+10",
"version": "0.8.2+11",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
35 changes: 35 additions & 0 deletions src/interfaces/accounting_setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
interface ITaxRate {
taxable: boolean;
rate: number;
}

interface ITaxSetting {
salesTax: ITaxRate;
purchaseTax: ITaxRate;
returnPeriodicity: string;
}

interface IField {
name: string;
value: string;
}

interface IAction {
name: string;
description: string;
fieldList: IField[];
}

interface IShortcut {
action: IAction;
keyList: string[];
}

export interface IAccountingSetting {
companyId: number;
companyName: string;
taxSettings: ITaxSetting;
currency: string;
lastDayOfFiscalYear: number;
shortcutList: IShortcut[];
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export interface IClient {
export interface ICustomerVendor {
id: number;
companyId: number;
name: string;
taxId: string;
favorite: boolean;
type: string;
note: string;
createdAt: number;
updatedAt: number;
}
15 changes: 15 additions & 0 deletions src/interfaces/user_action_log.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface IUserActionLog {
id: number;
sessionId: string;
userId: number;
actionType: string;
actionDescription: string;
actionTime: number;
ipAddress: string;
userAgent: string;
apiEndpoint: string;
httpMethod: string;
requestPayload: Record<string, string>;
httpStatusCode: number;
statusMessage: string;
}
15 changes: 15 additions & 0 deletions src/interfaces/user_setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface IUserSetting {
id: number;
userId: number;
firstName: string;
lastName: string;
country: string;
phone: string;
language: string;
systemNotification: boolean;
updateAndSubscriptionNotification: boolean;
emailNotification: boolean;
createdAt: number;
updatedAt: number;
deletedAt: number;
}
105 changes: 0 additions & 105 deletions src/lib/utils/repo/client.repo.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/utils/repo/user_agreement.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function createUserAgreement(
return createdUserAgreement;
}

export async function deleteUserAgreement(
export async function deleteUserAgreementForTesting(
userId: number,
agreementHash: string
): Promise<UserAgreement> {
Expand Down
82 changes: 0 additions & 82 deletions src/lib/utils/repo_test/client_repo.test.ts

This file was deleted.

7 changes: 5 additions & 2 deletions src/lib/utils/repo_test/user_agreement.repo.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { createUserAgreement, deleteUserAgreement } from '@/lib/utils/repo/user_agreement.repo';
import {
createUserAgreement,
deleteUserAgreementForTesting,
} from '@/lib/utils/repo/user_agreement.repo';
import { UserAgreement } from '@prisma/client';

describe('User Agreement Repository Tests', () => {
Expand All @@ -8,7 +11,7 @@ describe('User Agreement Repository Tests', () => {
describe('createUserAgreement', () => {
it('should create a new user agreement', async () => {
const userAgreement: UserAgreement = await createUserAgreement(testUserId, testAgreementHash);
await deleteUserAgreement(testUserId, testAgreementHash);
await deleteUserAgreementForTesting(testUserId, testAgreementHash);
expect(userAgreement).toBeDefined();
expect(userAgreement.userId).toBe(testUserId);
expect(userAgreement.agreementHash).toBe(testAgreementHash);
Expand Down
Loading