"feat: rename 'createdDate' to 'createDate' across frontend, backend, and mobile codebases"

This commit is contained in:
louiscklaw
2025-05-30 20:15:27 +08:00
parent fd20a3531b
commit 8b73b583cd
33 changed files with 1273 additions and 1425 deletions

View File

@@ -1,3 +1,5 @@
// src/pages/dashboard/kanban/index.tsx
import { CONFIG } from 'src/global-config';
import { KanbanView } from 'src/sections/kanban/view';

View File

@@ -186,7 +186,7 @@ export function InvoiceDetails({ invoice }: Props) {
<Typography variant="subtitle2" sx={{ mb: 1 }}>
Date create
</Typography>
{fDate(invoice?.createdDate)}
{fDate(invoice?.createDate)}
</Stack>
<Stack sx={{ typography: 'body2' }}>

View File

@@ -58,11 +58,11 @@ export const NewInvoiceSchema = zod
message: 'Invoice to is required!',
}),
sent: zod.number().default(0),
createdDate: schemaHelper.date({ message: { required: 'Create date is required!' } }),
createDate: schemaHelper.date({ message: { required: 'Create date is required!' } }),
dueDate: schemaHelper.date({ message: { required: 'Due date is required!' } }),
// Not required
})
.refine((data) => !fIsAfter(data.createdDate, data.dueDate), {
.refine((data) => !fIsAfter(data.createDate, data.dueDate), {
message: 'Due date cannot be earlier than create date!',
path: ['dueDate'],
});
@@ -82,7 +82,7 @@ export function InvoiceNewEditForm({ currentInvoice }: Props) {
const defaultValues: NewInvoiceSchemaType = {
invoiceNumber: 'INV-1990',
createdDate: today(),
createDate: today(),
dueDate: null,
taxes: 0,
shipping: 0,

View File

@@ -139,7 +139,7 @@ function InvoicePdfDocument({ invoice, currentStatus }: InvoicePdfDocumentProps)
shipping,
subtotal,
invoiceTo,
createdDate,
createDate,
totalAmount,
invoiceFrom,
invoiceNumber,
@@ -197,7 +197,7 @@ function InvoicePdfDocument({ invoice, currentStatus }: InvoicePdfDocumentProps)
<View style={[styles.container, styles.mb40]}>
<View style={{ width: '50%' }}>
<Text style={[styles.text1Bold, styles.mb4]}>Date create</Text>
<Text style={[styles.text2]}>{fDate(createdDate)}</Text>
<Text style={[styles.text2]}>{fDate(createDate)}</Text>
</View>
<View style={{ width: '50%' }}>
<Text style={[styles.text1Bold, styles.mb4]}>Due date</Text>

View File

@@ -141,8 +141,8 @@ export function InvoiceTableRow({
<TableCell>
<ListItemText
primary={fDate(row.createdDate)}
secondary={fTime(row.createdDate)}
primary={fDate(row.createDate)}
secondary={fTime(row.createDate)}
slotProps={{
primary: { noWrap: true, sx: { typography: 'body2' } },
secondary: { sx: { mt: 0.5, typography: 'caption' } },

View File

@@ -1,3 +1,5 @@
// src/sections/kanban/view/kanban-view.tsx
import type {
DragEndEvent,
DragOverEvent,

View File

@@ -32,7 +32,7 @@ export type IInvoiceItem = {
dueDate: IDateValue;
invoiceNumber: string;
items: IInvoiceItemItem[];
createdDate: IDateValue;
createDate: IDateValue;
invoiceTo: IAddressItem;
invoiceFrom: IAddressItem;
};