Skip to content

Commit

Permalink
feat: 아직 선물 등록되지 않은 경우 대응
Browse files Browse the repository at this point in the history
  • Loading branch information
alstn2468 committed Nov 11, 2024
1 parent 7f00428 commit ef79247
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ const Item = styled.span`
}
`;

const DisabledText = styled.span`
${({ theme }) => theme.typo.b2};
color: ${({ theme }) => theme.palette.grey.g30};
`;

const Empty = styled.div`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -146,6 +151,7 @@ export default {
HeaderRow,
Row,
Item,
DisabledText,
Empty,
ResetButton,
TooltipItemColumn,
Expand Down
17 changes: 11 additions & 6 deletions apps/admin/src/components/ReservationTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,23 @@ const getColumns = (ticketStatus: TicketStatus) => [
: []),
columnHelper.accessor(
(row) => {
if (ticketStatus === 'CANCEL') {
return row.cancelInfo?.canceledAt;
if (ticketStatus === 'CANCEL' && row.cancelInfo) {
return { type: 'date', value: row.cancelInfo.canceledAt };
}

return row.createdAt;
return row.gift && !row.gift.done
? { type: 'text', value: '아직 선물이 등록되지 않았습니다.' }
: { type: 'date', value: row.createdAt };
},
{
header: ticketStatus === 'CANCEL' ? '취소 일시' : '결제 일시',
cell: (props) => {
const value = props.getValue();
if (value) {
return format(value, 'yyyy/MM/dd HH:mm');
const { type, value } = props.getValue();
switch (type) {
case 'date':
return format(value, 'yyyy/MM/dd HH:mm');
case 'text':
return <Styled.DisabledText>{value}</Styled.DisabledText>;
}
return '-';
},
Expand Down
13 changes: 11 additions & 2 deletions packages/api/src/types/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,24 @@ export interface CancelInfoResponse {
canceledAt: string;
}

export interface GiftResponseV2 {
/** 선물 ID */
id: number;
/** 선물 수신 완료 여부 */
done: boolean;
/** 선물 생성 일시 */
createdAt: string;
}

export interface ReservationWithTicketsResponse {
/** 예매 ID */
reservationId: number;
/** cs용(유저용) 예매 ID */
csReservationId: number;
/** 예매 결제 관리 상태 */
paymentManagementStatus: TicketStatus;
/** 선물 여부 */
gift: boolean;
/** 선물 정보 선물이 아니면 null */
gift?: GiftResponseV2;
/** 판매 티켓 타입 정보. 만약 삭제된 경우 null */
salesTicketType?: SalesTicketTypeResponseV2;
/** 티켓 정보 목록. */
Expand Down

0 comments on commit ef79247

Please sign in to comment.