+ new field named "max_amount_per_day" on transfertype
This commit is contained in:
@ -80,7 +80,8 @@ const AddDialog = () => {
|
|||||||
status_approval: '',
|
status_approval: '',
|
||||||
status_kind: '',
|
status_kind: '',
|
||||||
created_by: '',
|
created_by: '',
|
||||||
created_at: ''
|
created_at: '',
|
||||||
|
max_amount_per_day: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
const [formField, setFormField] = useState(initialState);
|
const [formField, setFormField] = useState(initialState);
|
||||||
@ -393,6 +394,34 @@ const AddDialog = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label className="form-label flex items-center gap-1 max-w-56">
|
||||||
|
Max Amount per day
|
||||||
|
</label>
|
||||||
|
<div className="grow">
|
||||||
|
<NumericFormat
|
||||||
|
className="input"
|
||||||
|
value={formField.max_amount_per_day}
|
||||||
|
thousandSeparator="."
|
||||||
|
decimalSeparator=","
|
||||||
|
allowNegative={false}
|
||||||
|
decimalScale={0}
|
||||||
|
isAllowed={({ floatValue }) =>
|
||||||
|
floatValue === undefined || Number.isInteger(floatValue)
|
||||||
|
}
|
||||||
|
onValueChange={(values) => {
|
||||||
|
setFormField((prev) => ({
|
||||||
|
...prev,
|
||||||
|
max_amount_per_day: values.floatValue || 0
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
placeholder="Enter Max Amount Per Day"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label className="form-label flex items-center gap-1 max-w-56">
|
<label className="form-label flex items-center gap-1 max-w-56">
|
||||||
|
|||||||
@ -80,6 +80,7 @@ const EditDialog = () => {
|
|||||||
minimum_amount: number;
|
minimum_amount: number;
|
||||||
maximum_amount: number;
|
maximum_amount: number;
|
||||||
max_transaction_per_day: number;
|
max_transaction_per_day: number;
|
||||||
|
max_amount_per_day: number;
|
||||||
status: string;
|
status: string;
|
||||||
type: string;
|
type: string;
|
||||||
status_approval: string;
|
status_approval: string;
|
||||||
@ -95,6 +96,7 @@ const EditDialog = () => {
|
|||||||
minimum_amount: 0,
|
minimum_amount: 0,
|
||||||
maximum_amount: 0,
|
maximum_amount: 0,
|
||||||
max_transaction_per_day: 0,
|
max_transaction_per_day: 0,
|
||||||
|
max_amount_per_day: 0,
|
||||||
status_approval: '',
|
status_approval: '',
|
||||||
status_kind: '',
|
status_kind: '',
|
||||||
type: '',
|
type: '',
|
||||||
@ -350,6 +352,7 @@ const EditDialog = () => {
|
|||||||
minimum_amount: response.data.minimum_amount,
|
minimum_amount: response.data.minimum_amount,
|
||||||
maximum_amount: response.data.maximum_amount,
|
maximum_amount: response.data.maximum_amount,
|
||||||
max_transaction_per_day: response.data.max_transaction_per_day,
|
max_transaction_per_day: response.data.max_transaction_per_day,
|
||||||
|
max_amount_per_day: response.data.max_amount_per_day,
|
||||||
status_approval: response.data.status_approval,
|
status_approval: response.data.status_approval,
|
||||||
status_kind: response.data.status_kind,
|
status_kind: response.data.status_kind,
|
||||||
type: response.data.type || '',
|
type: response.data.type || '',
|
||||||
@ -589,6 +592,33 @@ const EditDialog = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label className="form-label flex items-center gap-1 max-w-56">
|
||||||
|
Max Amount per day
|
||||||
|
</label>
|
||||||
|
<div className="grow">
|
||||||
|
<NumericFormat
|
||||||
|
className="input"
|
||||||
|
value={formField.max_amount_per_day}
|
||||||
|
thousandSeparator="."
|
||||||
|
decimalSeparator=","
|
||||||
|
allowNegative={false}
|
||||||
|
decimalScale={0}
|
||||||
|
isAllowed={({ floatValue }) =>
|
||||||
|
floatValue === undefined || Number.isInteger(floatValue)
|
||||||
|
}
|
||||||
|
onValueChange={(values) => {
|
||||||
|
setFormField((prev) => ({
|
||||||
|
...prev,
|
||||||
|
max_amount_per_day: values.floatValue || 0
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
placeholder="Enter Max Amount Per Day"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label className="form-label flex items-center gap-1 max-w-56">
|
<label className="form-label flex items-center gap-1 max-w-56">
|
||||||
|
|||||||
@ -52,6 +52,7 @@ interface TransferType {
|
|||||||
walletDestinationId: string;
|
walletDestinationId: string;
|
||||||
status: string;
|
status: string;
|
||||||
type: string;
|
type: string;
|
||||||
|
max_amount_per_day: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ContextProps {
|
interface ContextProps {
|
||||||
@ -206,6 +207,17 @@ const ManageTransferTypeContextProvider = ({ children }: { children: React.React
|
|||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: { headerClassName: 'w-[250px]' }
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.max_amount_per_day,
|
||||||
|
id: 'max_amount_per_day',
|
||||||
|
header: ({ column }) => (
|
||||||
|
<DataGridColumnHeader title="Max Amount Per Day" column={column} />
|
||||||
|
),
|
||||||
|
cell: ({ row }) => formatInteger(row.original.max_amount_per_day),
|
||||||
|
enableSorting: false,
|
||||||
|
enableHiding: false,
|
||||||
|
meta: { headerClassName: 'w-[250px]' }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row: { type: string }) => {
|
accessorFn: (row: { type: string }) => {
|
||||||
const mapping: Record<string, string> = {
|
const mapping: Record<string, string> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user