Skip to content

Commit

Permalink
fix(service): resolve customer type
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Jul 24, 2024
1 parent 7e66b57 commit e3c899d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,16 +1155,16 @@ export class OrderingService
];

if (customer.payload?.private) {
order.customer_type = CustomerType.PRIVATE;
order.user_id = customer.payload.private.user_id;
order.customer_type ??= CustomerType.PRIVATE;
order.user_id ??= customer?.payload?.private?.user_id;
}
else if (customer.payload?.commercial) {
order.customer_type = CustomerType.COMMERCIAL;
order.customer_vat_id ??= organization.payload.vat_id;
order.customer_type ??= CustomerType.COMMERCIAL;
order.customer_vat_id ??= organization?.payload?.vat_id;
}
else if (customer.payload?.public_sector) {
order.customer_type = CustomerType.PUBLIC_SECTOR;
order.customer_vat_id ??= organization.payload.vat_id;
order.customer_type ??= CustomerType.PUBLIC_SECTOR;
order.customer_vat_id ??= organization?.payload?.vat_id;
}

if (order.items?.length) {
Expand Down

0 comments on commit e3c899d

Please sign in to comment.