Skip to content

Commit 0281b1f

Browse files
committed
Send first and last name for invoice info
1 parent b96ff0b commit 0281b1f

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

backend/pretix/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ def get_quotas(conference: Conference) -> Dict[str, Quota]:
248248
@strawberry.type
249249
class InvoiceInformationErrors:
250250
company: list[str] = strawberry.field(default_factory=list)
251-
name: list[str] = strawberry.field(default_factory=list)
251+
first_name: list[str] = strawberry.field(default_factory=list)
252+
last_name: list[str] = strawberry.field(default_factory=list)
252253
street: list[str] = strawberry.field(default_factory=list)
253254
zipcode: list[str] = strawberry.field(default_factory=list)
254255
city: list[str] = strawberry.field(default_factory=list)
@@ -316,7 +317,8 @@ def validate(
316317
class InvoiceInformation:
317318
is_business: bool
318319
company: Optional[str]
319-
name: str
320+
first_name: str
321+
last_name: str
320322
street: str
321323
zipcode: str
322324
city: str
@@ -328,7 +330,8 @@ class InvoiceInformation:
328330

329331
def validate(self, errors: CreateOrderErrors) -> CreateOrderErrors:
330332
required_fields = [
331-
"name",
333+
"first_name",
334+
"last_name",
332335
"street",
333336
"zipcode",
334337
"city",

frontend/src/components/checkout-page-handler/billing-card.tsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,23 @@ export const BillingCard = ({
129129
)}
130130
<InputWrapper
131131
required={true}
132-
title={<FormattedMessage id="orderInformation.name" />}
132+
title={<FormattedMessage id="orderInformation.firstName" />}
133133
>
134134
<Input
135-
{...text("name")}
135+
{...text("firstName")}
136+
required={true}
137+
placeholder={inputPlaceholder}
138+
errors={invoiceInformationErrors?.firstName}
139+
/>
140+
</InputWrapper>
141+
<InputWrapper
142+
required={true}
143+
title={<FormattedMessage id="orderInformation.lastName" />}
144+
>
145+
<Input
146+
{...text("lastName")}
136147
required={true}
137148
placeholder={inputPlaceholder}
138-
errors={invoiceInformationErrors?.name}
139149
/>
140150
</InputWrapper>
141151
{isBusiness && (
@@ -154,13 +164,15 @@ export const BillingCard = ({
154164
)}
155165
<InputWrapper
156166
required={true}
157-
title={<FormattedMessage id="orderInformation.zipCode" />}
167+
title={<FormattedMessage id="orderInformation.address" />}
158168
>
159-
<Input
160-
{...text("zipCode")}
169+
<Textarea
170+
rows={3}
171+
{...textarea("address")}
172+
autoComplete="street-address"
161173
required={true}
162174
placeholder={inputPlaceholder}
163-
errors={invoiceInformationErrors?.zipcode}
175+
errors={invoiceInformationErrors?.street}
164176
/>
165177
</InputWrapper>
166178

@@ -177,15 +189,13 @@ export const BillingCard = ({
177189
</InputWrapper>
178190
<InputWrapper
179191
required={true}
180-
title={<FormattedMessage id="orderInformation.address" />}
192+
title={<FormattedMessage id="orderInformation.zipCode" />}
181193
>
182-
<Textarea
183-
rows={3}
184-
{...textarea("address")}
185-
autoComplete="street-address"
194+
<Input
195+
{...text("zipCode")}
186196
required={true}
187197
placeholder={inputPlaceholder}
188-
errors={invoiceInformationErrors?.street}
198+
errors={invoiceInformationErrors?.zipcode}
189199
/>
190200
</InputWrapper>
191201
<InputWrapper

frontend/src/components/tickets-page/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export type InvoiceInformationState = {
22
isBusiness: boolean;
33
companyName: string;
4-
name: string;
4+
firstName: string;
5+
lastName: string;
56
fiscalCode: string;
67
pec: string;
78
sdi: string;

frontend/src/locale/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,8 @@ Click the box to change. If left empty, we will assume you are available.`,
651651
"orderInformation.individualConsumer": "Individual Customer",
652652
"orderInformation.businessConsumer": "Business Customer",
653653
"orderInformation.companyName": "Company name",
654-
"orderInformation.name": "Name",
654+
"orderInformation.firstName": "First name",
655+
"orderInformation.lastName": "Last name",
655656
"orderInformation.vatId": "VAT ID",
656657
"orderInformation.address": "Address",
657658
"orderInformation.zipCode": "Zip Code",
@@ -1434,7 +1435,8 @@ The sooner you buy your ticket, the more you save!`,
14341435
"orderInformation.individualConsumer": "Persona individuale",
14351436
"orderInformation.businessConsumer": "Azienda",
14361437
"orderInformation.companyName": "Nome azienda",
1437-
"orderInformation.name": "Nome completo",
1438+
"orderInformation.firstName": "Nome",
1439+
"orderInformation.lastName": "Cognome",
14381440
"orderInformation.vatId": "Partita IVA",
14391441
"orderInformation.address": "Indirizzo",
14401442
"orderInformation.zipCode": "CAP",

0 commit comments

Comments
 (0)