-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransaction.interface.ts
More file actions
61 lines (56 loc) · 1.84 KB
/
transaction.interface.ts
File metadata and controls
61 lines (56 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
// Generated with [Claude Code](https://claude.ai/code)
import {
TRANSACTION_TYPE_BUNDLE,
TRANSACTION_TYPE_CERTIFICATION,
TRANSACTION_TYPE_EVENT,
TRANSACTION_TYPE_INDIVIDUAL_SUPPORT,
TRANSACTION_TYPE_SUBSCRIPTION,
TRANSACTION_TYPE_TRAINING,
} from '../constants/transaction.constants';
/** Union of all known TRANSACTION_TYPE values */
export type TransactionType =
| typeof TRANSACTION_TYPE_EVENT
| typeof TRANSACTION_TYPE_TRAINING
| typeof TRANSACTION_TYPE_CERTIFICATION
| typeof TRANSACTION_TYPE_SUBSCRIPTION
| typeof TRANSACTION_TYPE_INDIVIDUAL_SUPPORT
| typeof TRANSACTION_TYPE_BUNDLE;
/**
* A single transaction in the user's purchase history
*/
export interface Transaction {
/** Unique record identifier (_KEY) */
id: string;
/** Source natural key — purchase_id, registration_id, or membership id (ORDER_ID) */
orderId: string;
/** Transaction date (CREATED_DATE) */
createdDate: string;
/** Name of the purchased product (NAME) */
name: string;
/** Type of transaction: training, certifications, subscription, events, individual (TRANSACTION_TYPE) */
transactionType: TransactionType | null;
/** Net revenue amount paid (NET_REVENUE) */
netRevenue: number;
/** Associated project ID (PROJECT_ID) */
projectId: string | null;
/** Associated project name (PROJECT_NAME) */
projectName: string | null;
}
/**
* Snowflake row shape for ANALYTICS.PLATINUM_LFX_ONE.USER_TRANSACTIONS
*/
export interface TransactionRow {
_KEY: string;
USER_NAME?: string;
USER_EMAIL?: string | null;
USER_ID?: string | null;
ORDER_ID: string;
NAME: string | null;
NET_REVENUE: number | null;
CREATED_DATE: string;
TRANSACTION_TYPE: TransactionType | null;
PROJECT_ID: string | null;
PROJECT_NAME: string | null;
}