diff --git a/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json b/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json index 1f441a49..ee7eda0d 100644 --- a/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json +++ b/apps/angular/projects/ordering/src/lib/proxy/generate-proxy.json @@ -215,6 +215,67 @@ "allowAnonymous": null, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, + "GetListPagedAsyncByInput": { + "uniqueName": "GetListPagedAsyncByInput", + "name": "GetListPagedAsync", + "httpMethod": "GET", + "url": "api/ordering/order/paged", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", + "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, "GetByOrderNoAsyncByOrderNo": { "uniqueName": "GetByOrderNoAsyncByOrderNo", "name": "GetByOrderNoAsync", @@ -252,11 +313,11 @@ "allowAnonymous": null, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, - "UpdateAsyncByIdAndInput": { - "uniqueName": "UpdateAsyncByIdAndInput", - "name": "UpdateAsync", - "httpMethod": "PUT", - "url": "api/ordering/order/{id}", + "SetAsCancelledAsyncByIdAndInput": { + "uniqueName": "SetAsCancelledAsyncByIdAndInput", + "name": "SetAsCancelledAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-cancelled", "supportedVersions": [], "parametersOnMethod": [ { @@ -269,9 +330,9 @@ }, { "name": "input", - "typeAsString": "EShopOnAbp.OrderingService.Orders.UpdateOrderDto, EShopOnAbp.OrderingService.Application.Contracts", - "type": "EShopOnAbp.OrderingService.Orders.UpdateOrderDto", - "typeSimple": "EShopOnAbp.OrderingService.Orders.UpdateOrderDto", + "typeAsString": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto", "isOptional": false, "defaultValue": null } @@ -293,8 +354,8 @@ "nameOnMethod": "input", "name": "input", "jsonName": null, - "type": "EShopOnAbp.OrderingService.Orders.UpdateOrderDto", - "typeSimple": "EShopOnAbp.OrderingService.Orders.UpdateOrderDto", + "type": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto", "isOptional": false, "defaultValue": null, "constraintTypes": null, @@ -303,10 +364,47 @@ } ], "returnValue": { - "type": "EShopOnAbp.OrderingService.Orders.OrderDto", - "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + "type": "System.Void", + "typeSimple": "System.Void" }, - "allowAnonymous": null, + "allowAnonymous": false, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "SetAsShippedAsyncById": { + "uniqueName": "SetAsShippedAsyncById", + "name": "SetAsShippedAsync", + "httpMethod": "POST", + "url": "api/ordering/order/{id}/set-as-shipped", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, "CreateAsyncByInput": { @@ -2098,7 +2196,39 @@ } ] }, - "EShopOnAbp.OrderingService.Orders.UpdateOrderDto": { + "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.PagedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.LimitedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.LimitedResultRequestDto": { "baseType": null, "isEnum": false, "enumNames": null, @@ -2106,11 +2236,84 @@ "genericArguments": null, "properties": [ { - "name": "OrderStatusId", + "name": "DefaultMaxResultCount", "jsonName": null, "type": "System.Int32", "typeSimple": "number", "isRequired": false + }, + { + "name": "MaxMaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + }, + { + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.PagedResultDto": { + "baseType": "Volo.Abp.Application.Dtos.ListResultDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "TotalCount", + "jsonName": null, + "type": "System.Int64", + "typeSimple": "number", + "isRequired": false + } + ] + }, + "Volo.Abp.Application.Dtos.ListResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "Items", + "jsonName": null, + "type": "[T]", + "typeSimple": "[T]", + "isRequired": false + } + ] + }, + "EShopOnAbp.OrderingService.Orders.SetAsCancelledDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "PaymentRequestId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isRequired": false + }, + { + "name": "PaymentRequestStatus", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false } ] }, diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts index 071bbefe..da2b3c9a 100644 --- a/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/models.ts @@ -57,6 +57,7 @@ export interface OrderItemDto extends EntityDto { units: number; } -export interface UpdateOrderDto { - orderStatusId: number; +export interface SetAsCancelledDto { + paymentRequestId?: string; + paymentRequestStatus?: string; } diff --git a/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts b/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts index 5ea19fdf..6b4e5b94 100644 --- a/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts +++ b/apps/angular/projects/ordering/src/lib/proxy/orders/order.service.ts @@ -1,5 +1,6 @@ -import type { GetMyOrdersInput, GetOrdersInput, OrderCreateDto, OrderDto, UpdateOrderDto } from './models'; +import type { GetMyOrdersInput, GetOrdersInput, OrderCreateDto, OrderDto, SetAsCancelledDto } from './models'; import { RestService } from '@abp/ng.core'; +import type { PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; import { Injectable } from '@angular/core'; @Injectable({ @@ -31,6 +32,14 @@ export class OrderService { }, { apiName: this.apiName }); + getListPaged = (input: PagedAndSortedResultRequestDto) => + this.restService.request>({ + method: 'GET', + url: '/api/ordering/order/paged', + params: { sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, + }, + { apiName: this.apiName }); + getMyOrders = (input: GetMyOrdersInput) => this.restService.request({ method: 'GET', @@ -47,13 +56,20 @@ export class OrderService { }, { apiName: this.apiName }); - update = (id: string, input: UpdateOrderDto) => - this.restService.request({ - method: 'PUT', - url: `/api/ordering/order/${id}`, + setAsCancelled = (id: string, input: SetAsCancelledDto) => + this.restService.request({ + method: 'POST', + url: `/api/ordering/order/${id}/set-as-cancelled`, body: input, }, { apiName: this.apiName }); + setAsShipped = (id: string) => + this.restService.request({ + method: 'POST', + url: `/api/ordering/order/${id}/set-as-shipped`, + }, + { apiName: this.apiName }); + constructor(private restService: RestService) {} } diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.component.html b/apps/angular/projects/ordering/src/pages/orders/orders.component.html index 0501af0c..f747ef32 100644 --- a/apps/angular/projects/ordering/src/pages/orders/orders.component.html +++ b/apps/angular/projects/ordering/src/pages/orders/orders.component.html @@ -10,7 +10,7 @@
- + @@ -27,16 +27,22 @@ + +
@@ -53,9 +59,6 @@ - - - @@ -63,4 +66,4 @@ - + diff --git a/apps/angular/projects/ordering/src/pages/orders/orders.component.ts b/apps/angular/projects/ordering/src/pages/orders/orders.component.ts index 3fb843c2..9a180d7d 100644 --- a/apps/angular/projects/ordering/src/pages/orders/orders.component.ts +++ b/apps/angular/projects/ordering/src/pages/orders/orders.component.ts @@ -29,6 +29,7 @@ export class OrdersComponent implements OnInit { }); } + openModal(order: OrderViewModel) { if (!order){ return; @@ -60,7 +61,7 @@ export class OrdersComponent implements OnInit { setAsCancelled(row: OrderViewModel){ this.confirmationService .warn('AbpOrdering::WillSetAsCancelled', { key: '::AreYouSure', defaultValue: 'Are you sure?' }) - .subscribe((status``) => { + .subscribe((status) => { if (status !== Confirmation.Status.confirm) { return; }