This commit is contained in:
dx-tan 2024-03-07 09:12:44 +07:00
parent 3de93f4019
commit 1f4e1fa874
4 changed files with 37 additions and 9 deletions

View File

@ -65,6 +65,7 @@ export interface MakeReportParams {
start_date: string;
end_date: string;
subsidiary: string;
report_type: string;
}
export type CustomUseMutationOptions<

View File

@ -10,6 +10,7 @@ import { useState } from 'react';
export interface ReportFormValues {
dateRange: [Dayjs, Dayjs];
subsidiary: string;
reportType: string;
}
const ReportsPage = () => {
@ -30,6 +31,7 @@ const ReportsPage = () => {
end_date: values.dateRange[1].format('YYYY-MM-DD'),
start_date: values.dateRange[0].format('YYYY-MM-DD'),
subsidiary: values.subsidiary,
report_type: values.reportType,
})
.then((data) => {
if (!!data && data?.report_id) {
@ -51,6 +53,8 @@ const ReportsPage = () => {
setIsModalOpen(false);
};
form.setFieldsValue({reportType: "accuracy"})
return (
<>
<SbtPageHeader
@ -122,6 +126,28 @@ const ReportsPage = () => {
]}
/>
</Form.Item>
<Form.Item
name='reportType'
label={t`Report Type`}
rules={[
{
required: true,
message: 'Please select a type',
},
]}
>
<Select
placeholder='Select a report type'
style={{ width: 200 }}
options={[
{ value: 'billing', label: 'billing' },
{ value: 'accuracy', label: 'accuracy' },
]}
// defaultValue='accuracy'
/>
</Form.Item>
</Form>
</Modal>
</>

View File

@ -32,12 +32,13 @@ export async function getReportDetailList(params: ReportDetailListParams) {
}
export async function makeReport(params: MakeReportParams) {
const { end_date, start_date, subsidiary } = params;
const { end_date, start_date, subsidiary, report_type } = params;
try {
const response = await API.post<MakeReportResponse>(`/ctel/make_report/`, {
start_date: start_date,
end_date: end_date,
subsidiary: subsidiary,
report_type: report_type,
});
return response.data;
} catch (error) {

View File

@ -89,12 +89,12 @@ services:
depends_on:
db-sbt:
condition: service_started
# command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input &&
# python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py compilemessages &&
# gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod
command: bash -c "tail -f > /dev/null"
command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py compilemessages &&
gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod
# command: bash -c "tail -f > /dev/null"
minio:
image: minio/minio
@ -179,8 +179,8 @@ services:
- ./cope2n-api:/app
working_dir: /app
# command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5"
command: bash -c "tail -f > /dev/null"
command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5"
# command: bash -c "tail -f > /dev/null"
# Back-end persistent
db-sbt: