Unverified Commit fd4a8592 authored by Ruslan Konviser's avatar Ruslan Konviser Committed by GitHub
Browse files

Merge pull request #1204 from ever-co/feat/#58-choose-order-type

feat: choose order type on new manual order
parents fbcc8c86 82b9f8ab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ input OrderCreateInput {
	warehouseId: String!
	products: [OrderProductCreateInput!]!
	options: WarehouseOrdersRouterCreateOptions
	orderType: Int
}

input WarehouseOrdersRouterCreateOptions {
+4 −2
Original line number Diff line number Diff line
import { Component, Input } from '@angular/core';
import Order from '@modules/server.common/entities/Order';
import { TranslateService } from '@ngx-translate/core';
import DeliveryType from '@modules/server.common/enums/DeliveryType';

@Component({
	selector: 'order-info',
@@ -10,15 +11,16 @@ import { TranslateService } from '@ngx-translate/core';
export class OrderInfoComponent {
	@Input()
	public order: Order;
	public type: DeliveryType;

	constructor(private translate: TranslateService) {}

	get orderType() {
		const type =
		this.type =
			this.order.orderType === 0
				? this.translate.instant('ORDER_TYPE.DELIVERY')
				: this.translate.instant('ORDER_TYPE.TAKEAWAY');

		return type;
		return this.type;
	}
}
+1 −1
Original line number Diff line number Diff line
<div>
<div class="customer">
	<div padding-vertical></div>

	<button ion-button color="dark" outline (click)="chooseOption(0)">
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ import { Component, EventEmitter, Output } from '@angular/core';
@Component({
	selector: 'choose-customer-option',
	styles: [
		'button { padding: 3.5%; background: none; border: 1px solid; } button:hover { color: #bd4742; border-color: #bd4742; }',
		'button { padding: 3.5%; margin-top: 2%; background: none; border: 1px solid; margin-left: 2%; } button:hover { color: #bd4742; border-color: #bd4742; } .customer{ text-align: center; }',
	],
	templateUrl: './choose-customer-option.component.html',
})
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr
import { WarehouseOrdersService } from '../../../services/warehouse-orders.service';
import { TranslateService } from '@ngx-translate/core';
import { AlertController } from '@ionic/angular';
import DeliveryType from '@modules/server.common/enums/DeliveryType';

@Component({
	selector: 'make-order',
@@ -30,6 +31,9 @@ export class MakeOrderComponent implements OnInit, OnDestroy {
	@Input()
	customerId: string;

	@Input()
	orderType: DeliveryType;

	@Input()
	orderFinishedEmitter: EventEmitter<void>;

@@ -75,6 +79,7 @@ export class MakeOrderComponent implements OnInit, OnDestroy {
		this._warehouseOrdersService
			.createOrder({
				userId: this.customerId,
				orderType: this.orderType,
				warehouseId: this.warehouseId,
				products: orderProducts,
			})
Loading