Skip to content

Commit

Permalink
fix: data type of some creation dates (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber authored and shauke committed Jan 31, 2024
1 parent 88de2a2 commit 7e6c02c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/core/models/cost-center/cost-center.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CostCenter } from './cost-center.model';
export type CostCenterData = Omit<CostCenter, 'orders'> & {
orders?: {
orderNo: string;
orderDate: number;
orderDate: number[];
orderStatus: string;
items: number;
buyer: { attributes: Attribute[] };
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/models/cost-center/cost-center.mapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ describe('Cost Center Mapper', () => {
{
orderNo: '1',
items: 2,
orderDate: 1234,
orderDate: [2024, 1, 10],
buyer: { attributes: [{ name: 'firstName', value: 'John' }] },
orderTotalGross: { currency: 'USD', value: 1000.23 },
orderTotalNet: { currency: 'USD', value: 800.87 },
},
{
orderNo: '2',
items: 4,
orderDate: 2341,
orderDate: [2024, 1, 10],
buyer: { attributes: [{ name: 'firstName', value: 'Jack' }] },
orderTotalGross: { currency: 'USD', value: 1000.23 },
orderTotalNet: { currency: 'USD', value: 800.87 },
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/cost-center/cost-center.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class CostCenterMapper {
orders: data.orders?.map(order => ({
documentNo: order.orderNo,
status: order.orderStatus,
creationDate: order.orderDate,
creationDate: order.orderDate.toString(),
attributes: order.buyer.attributes,
totalProductQuantity: order.items,
totals: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/order/order.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ShippingMethodData } from 'ish-core/models/shipping-method/shipping-met

export interface OrderBaseData extends BasketBaseData {
documentNumber: string;
creationDate: number;
creationDate: string;
orderCreation: {
status: 'COMPLETED' | 'ROLLED_BACK' | 'STOPPED' | 'CONTINUE';
stopAction?: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/order/order.mapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { OrderMapper } from './order.mapper';
describe('Order Mapper', () => {
const orderBaseData = {
documentNumber: '4711',
creationDate: 0,
creationDate: '2024-01-26T09:52:16Z',
status: 'New',
statusCode: 'NEW',
id: 'order_1234',
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/order/order.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type OrderBasket = Omit<AbstractBasket<OrderLineItem>, 'approval'>;

export interface Order extends OrderBasket {
documentNo: string;
creationDate: number;
creationDate: string;
orderCreation: {
status: 'COMPLETED' | 'ROLLED_BACK' | 'STOPPED' | 'CONTINUE';
stopAction?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export interface OrderTemplateData extends OrderTemplateHeader {
itemsCount?: number;
name?: string;
uri?: string;
creationDate?: Date;
creationDate?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface OrderTemplate extends OrderTemplateHeader {
id: string;
items?: OrderTemplateItem[];
itemsCount?: number;
creationDate?: Date;
creationDate?: number;
}

export interface OrderTemplateItem {
Expand Down

0 comments on commit 7e6c02c

Please sign in to comment.