wip
This commit is contained in:
@@ -44,73 +44,73 @@
|
||||
"action.transferred": "Transferred",
|
||||
"action.locking_changed": "Locking Changed",
|
||||
|
||||
"metadata.bill_with_amount": "Bill {{billNumber}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.bill": "Bill {{billNumber}}",
|
||||
"metadata.invoice_with_balance": "Invoice {{invoiceNumber}} - Balance: {{balance}} {{currencyCode}}",
|
||||
"metadata.invoice": "Invoice {{invoiceNumber}}",
|
||||
"metadata.receipt_with_amount": "Receipt {{receiptNumber}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.receipt": "Receipt {{receiptNumber}}",
|
||||
"metadata.estimate_with_total": "Estimate {{estimateNumber}} - {{total}} {{currencyCode}}",
|
||||
"metadata.estimate": "Estimate {{estimateNumber}}",
|
||||
"metadata.payment_receive_with_amount": "Payment {{paymentReceiveNo}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.payment_receive": "Payment {{paymentReceiveNo}}",
|
||||
"metadata.payment_made_with_amount": "Payment {{paymentNumber}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.payment_made": "Payment {{paymentNumber}}",
|
||||
"metadata.expense_with_currency": "Expense - {{amount}} {{currencyCode}}",
|
||||
"metadata.expense": "Expense - {{amount}}",
|
||||
"metadata.bill_with_amount": "Bill {billNumber} - {amount} {currencyCode}",
|
||||
"metadata.bill": "Bill {billNumber}",
|
||||
"metadata.invoice_with_balance": "Invoice {invoiceNumber} - Balance: {balance} {currencyCode}",
|
||||
"metadata.invoice": "Invoice {invoiceNumber}",
|
||||
"metadata.receipt_with_amount": "Receipt {receiptNumber} - {amount} {currencyCode}",
|
||||
"metadata.receipt": "Receipt {receiptNumber}",
|
||||
"metadata.estimate_with_total": "Estimate {estimateNumber} - {total} {currencyCode}",
|
||||
"metadata.estimate": "Estimate {estimateNumber}",
|
||||
"metadata.payment_receive_with_amount": "Payment {paymentReceiveNo} - {amount} {currencyCode}",
|
||||
"metadata.payment_receive": "Payment {paymentReceiveNo}",
|
||||
"metadata.payment_made_with_amount": "Payment {paymentNumber} - {amount} {currencyCode}",
|
||||
"metadata.payment_made": "Payment {paymentNumber}",
|
||||
"metadata.expense_with_currency": "Expense - {amount} {currencyCode}",
|
||||
"metadata.expense": "Expense - {amount}",
|
||||
"metadata.expense_plain": "Expense",
|
||||
"metadata.credit_note_with_amount": "Credit Note {{creditNoteNumber}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.credit_note": "Credit Note {{creditNoteNumber}}",
|
||||
"metadata.vendor_credit_with_total": "Vendor Credit {{vendorCreditNumber}} - {{total}} {{currencyCode}}",
|
||||
"metadata.vendor_credit": "Vendor Credit {{vendorCreditNumber}}",
|
||||
"metadata.journal_with_amount": "Journal {{journalNumber}} - {{amount}} {{currencyCode}}",
|
||||
"metadata.journal": "Journal {{journalNumber}}",
|
||||
"metadata.cashflow_with_currency": "Cashflow - {{amount}} {{currencyCode}}",
|
||||
"metadata.cashflow": "Cashflow - {{amount}}",
|
||||
"metadata.credit_note_with_amount": "Credit Note {creditNoteNumber} - {amount} {currencyCode}",
|
||||
"metadata.credit_note": "Credit Note {creditNoteNumber}",
|
||||
"metadata.vendor_credit_with_total": "Vendor Credit {vendorCreditNumber} - {total} {currencyCode}",
|
||||
"metadata.vendor_credit": "Vendor Credit {vendorCreditNumber}",
|
||||
"metadata.journal_with_amount": "Journal {journalNumber} - {amount} {currencyCode}",
|
||||
"metadata.journal": "Journal {journalNumber}",
|
||||
"metadata.cashflow_with_currency": "Cashflow - {amount} {currencyCode}",
|
||||
"metadata.cashflow": "Cashflow - {amount}",
|
||||
"metadata.cashflow_plain": "Cashflow",
|
||||
"metadata.account_with_code": "Account: {{name}} ({{code}})",
|
||||
"metadata.account": "Account: {{name}}",
|
||||
"metadata.account_with_code": "Account: {name} ({code})",
|
||||
"metadata.account": "Account: {name}",
|
||||
"metadata.account_plain": "Account",
|
||||
"metadata.adjustment": "Adjustment: {{reason}}",
|
||||
"metadata.adjustment": "Adjustment: {reason}",
|
||||
"metadata.adjustment_plain": "Inventory Adjustment",
|
||||
"metadata.transfer": "Transfer: {{transactionNumber}}",
|
||||
"metadata.transfer": "Transfer: {transactionNumber}",
|
||||
"metadata.transfer_plain": "Warehouse Transfer",
|
||||
"metadata.item_with_code": "{{name}} ({{code}})",
|
||||
"metadata.item": "{{name}}",
|
||||
"metadata.item_with_code": "{name} ({code})",
|
||||
"metadata.item": "{name}",
|
||||
"metadata.item_plain": "Item",
|
||||
"metadata.customer_with_email": "{{displayName}} ({{email}})",
|
||||
"metadata.customer": "{{displayName}}",
|
||||
"metadata.customer_with_email": "{displayName} ({email})",
|
||||
"metadata.customer": "{displayName}",
|
||||
"metadata.customer_plain": "Customer",
|
||||
"metadata.vendor_with_email": "{{displayName}} ({{email}})",
|
||||
"metadata.vendor": "{{displayName}}",
|
||||
"metadata.vendor_with_email": "{displayName} ({email})",
|
||||
"metadata.vendor": "{displayName}",
|
||||
"metadata.vendor_plain": "Vendor",
|
||||
"metadata.role_with_old": "Role: {{roleName}} (was: {{oldRoleName}})",
|
||||
"metadata.role": "Role: {{roleName}}",
|
||||
"metadata.role_with_old": "Role: {roleName} (was: {oldRoleName})",
|
||||
"metadata.role": "Role: {roleName}",
|
||||
"metadata.role_plain": "Role",
|
||||
"metadata.tax_rate": "{{name}} - {{rate}}%",
|
||||
"metadata.tax_rate_name": "{{name}}",
|
||||
"metadata.tax_rate": "{name} - {rate}%",
|
||||
"metadata.tax_rate_name": "{name}",
|
||||
"metadata.tax_rate_plain": "Tax Rate",
|
||||
"metadata.warehouse": "Warehouse: {{code}}",
|
||||
"metadata.warehouse": "Warehouse: {code}",
|
||||
"metadata.warehouse_plain": "Warehouse",
|
||||
"metadata.branch_with_code": "{{name}} ({{code}})",
|
||||
"metadata.branch": "{{name}}",
|
||||
"metadata.branch_with_code": "{name} ({code})",
|
||||
"metadata.branch": "{name}",
|
||||
"metadata.branch_plain": "Branch",
|
||||
"metadata.item_category": "Category: {{name}}",
|
||||
"metadata.item_category": "Category: {name}",
|
||||
"metadata.item_category_plain": "Item Category",
|
||||
"metadata.bank_rule": "Rule: {{name}}",
|
||||
"metadata.bank_rule": "Rule: {name}",
|
||||
"metadata.bank_rule_plain": "Bank Rule",
|
||||
"metadata.locking_with_date": "Module: {{module}} locked to {{lockToDate}}",
|
||||
"metadata.locking_module": "Module: {{module}}",
|
||||
"metadata.locking_with_date": "Module: {module} locked to {lockToDate}",
|
||||
"metadata.locking_module": "Module: {module}",
|
||||
"metadata.locking_plain": "Transactions Locking",
|
||||
"metadata.refund_amount": "Refund - {{amount}}",
|
||||
"metadata.refund_amount": "Refund - {amount}",
|
||||
"metadata.refund_plain": "Refund",
|
||||
"metadata.imported_with_payee": "Imported - {{payee}}: {{amount}} {{currencyCode}}",
|
||||
"metadata.imported": "Imported - {{amount}} {{currencyCode}}",
|
||||
"metadata.imported_with_payee": "Imported - {payee}: {amount} {currencyCode}",
|
||||
"metadata.imported": "Imported - {amount} {currencyCode}",
|
||||
"metadata.imported_plain": "Imported Transaction",
|
||||
"metadata.plaid_with_batch": "Plaid Sync - Account {{plaidAccountId}} (Batch: {{batch}})",
|
||||
"metadata.plaid": "Plaid Sync - Account {{plaidAccountId}}",
|
||||
"metadata.plaid_with_batch": "Plaid Sync - Account {plaidAccountId} (Batch: {batch})",
|
||||
"metadata.plaid": "Plaid Sync - Account {plaidAccountId}",
|
||||
"metadata.plaid_plain": "Plaid Sync",
|
||||
"metadata.bank_with_payee": "{{payee}}: {{amount}} {{currencyCode}}",
|
||||
"metadata.bank": "{{amount}} {{currencyCode}}",
|
||||
"metadata.bank_with_payee": "{payee}: {amount} {currencyCode}",
|
||||
"metadata.bank": "{amount} {currencyCode}",
|
||||
"metadata.bank_plain": "Bank Transaction"
|
||||
}
|
||||
|
||||
+13
-5
@@ -1,9 +1,17 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class GetAuditLogFilterOptionsResponseDto {
|
||||
@ApiProperty({ type: [String], example: ['sale_invoice', 'bill', 'payment'] })
|
||||
subjects: string[];
|
||||
class AuditLogFilterOptionDto {
|
||||
@ApiProperty({ example: 'SaleInvoice' })
|
||||
key: string;
|
||||
|
||||
@ApiProperty({ type: [String], example: ['created', 'edited', 'deleted'] })
|
||||
actions: string[];
|
||||
@ApiProperty({ example: 'Sale Invoice' })
|
||||
label: string;
|
||||
}
|
||||
|
||||
export class GetAuditLogFilterOptionsResponseDto {
|
||||
@ApiProperty({ type: [AuditLogFilterOptionDto] })
|
||||
subjects: AuditLogFilterOptionDto[];
|
||||
|
||||
@ApiProperty({ type: [AuditLogFilterOptionDto] })
|
||||
actions: AuditLogFilterOptionDto[];
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { snakeCase } from 'lodash';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import { AuditLog } from '../models/AuditLog.model';
|
||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||
|
||||
@@ -18,6 +18,7 @@ export class GetAuditLogFilterOptionsService {
|
||||
constructor(
|
||||
@Inject(AuditLog.name)
|
||||
private readonly auditLogModel: TenantModelProxy<typeof AuditLog>,
|
||||
private readonly i18n: I18nService,
|
||||
) {}
|
||||
|
||||
async getFilterOptions(): Promise<AuditLogFilterOptions> {
|
||||
@@ -37,11 +38,11 @@ export class GetAuditLogFilterOptionsService {
|
||||
subjects: subjectRows
|
||||
.map((r) => r.subject)
|
||||
.filter(Boolean)
|
||||
.map((key) => ({ key, label: snakeCase(key) })),
|
||||
.map((key) => ({ key, label: this.i18n.t(`audit_log.subject.${key}`) })),
|
||||
actions: actionRows
|
||||
.map((r) => r.action)
|
||||
.filter(Boolean)
|
||||
.map((key) => ({ key, label: snakeCase(key) })),
|
||||
.map((key) => ({ key, label: this.i18n.t(`audit_log.action.${key}`) })),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+16226
-13197
File diff suppressed because it is too large
Load Diff
@@ -2,3 +2,5 @@ packages:
|
||||
# all packages in direct subdirs of packages/
|
||||
- 'packages/*'
|
||||
- 'shared/*'
|
||||
allowBuilds:
|
||||
bcrypt: true
|
||||
|
||||
Reference in New Issue
Block a user