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

Cancelling order is not updating capacity assignments #325

Merged
merged 2 commits into from
Dec 19, 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 backend/app/Services/Domain/Order/OrderCancelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function __construct(
public function cancelOrder(OrderDomainObject $order): void
{
$this->databaseManager->transaction(function () use ($order) {
$this->cancelAttendees($order);
$this->adjustTicketQuantities($order);
$this->cancelAttendees($order);
$this->updateOrderStatus($order);

$event = $this->eventRepository
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/forms/CapaciyAssigmentForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {InputGroup} from "../../common/InputGroup";
import {MultiSelect, NumberInput, Switch, TextInput} from "@mantine/core";
import {MultiSelect, NumberInput, TextInput} from "@mantine/core";
import {t} from "@lingui/macro";
import {UseFormReturnType} from "@mantine/form";
import {CapacityAssignmentRequest, Ticket} from "../../../types.ts";
import {CustomSelect, ItemProps} from "../../common/CustomSelect";
import {IconCheck, IconTicket, IconX} from "@tabler/icons-react";

interface CapaciyAssigmentFormProps {
interface CapacityAssigmentFormProps {
form: UseFormReturnType<CapacityAssignmentRequest>;
tickets: Ticket[],
}

export const CapaciyAssigmentForm = ({form, tickets}: CapaciyAssigmentFormProps) => {
export const CapacityAssigmentForm = ({form, tickets}: CapacityAssigmentFormProps) => {
const statusOptions: ItemProps[] = [
{
icon: <IconCheck/>,
Expand All @@ -23,7 +23,7 @@ export const CapaciyAssigmentForm = ({form, tickets}: CapaciyAssigmentFormProps)
icon: <IconX/>,
label: t`Inactive`,
value: 'INACTIVE',
description: t`Disable this capacity track capacity without stopping ticket sales`,
description: t`Disabling this capacity will track sales but not stop them when the limit is reached`,
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CapacityAssignmentRequest, GenericModalProps, Ticket} from "../../../types.ts";
import {Modal} from "../../common/Modal";
import {t} from "@lingui/macro";
import {CapaciyAssigmentForm} from "../../forms/CapaciyAssigmentForm";
import {CapacityAssigmentForm} from "../../forms/CapaciyAssigmentForm";
import {useForm} from "@mantine/form";
import {Button} from "@mantine/core";
import {useCreateCapacityAssignment} from "../../../mutations/useCreateCapacityAssignment.ts";
Expand Down Expand Up @@ -69,7 +69,7 @@ export const CreateCapacityAssignmentModal = ({onClose}: GenericModalProps) => {
{!eventHasTickets && <NoTickets/>}
{eventHasTickets && (
<form onSubmit={form.onSubmit(handleSubmit)}>
{event && <CapaciyAssigmentForm form={form} tickets={event.tickets as Ticket[]}/>}
{event && <CapacityAssigmentForm form={form} tickets={event.tickets as Ticket[]}/>}
<Button
type={'submit'}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CapacityAssignmentRequest, GenericModalProps, IdParam, Ticket} from "../../../types.ts";
import {Modal} from "../../common/Modal";
import {t} from "@lingui/macro";
import {CapaciyAssigmentForm} from "../../forms/CapaciyAssigmentForm";
import {CapacityAssigmentForm} from "../../forms/CapaciyAssigmentForm";
import {useForm} from "@mantine/form";
import {Button} from "@mantine/core";
import {showSuccess} from "../../../utilites/notifications.tsx";
Expand Down Expand Up @@ -65,7 +65,7 @@ export const EditCapacityAssignmentModal = ({
return (
<Modal opened onClose={onClose} heading={t`Edit Capacity Assignment`}>
<form onSubmit={form.onSubmit(handleSubmit)}>
{event && <CapaciyAssigmentForm form={form} tickets={event.tickets as Ticket[]}/>}
{event && <CapacityAssigmentForm form={form} tickets={event.tickets as Ticket[]}/>}
<Button
type={'submit'}
fullWidth
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/de.js

Large diffs are not rendered by default.

Loading
Loading