Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
wwahammy committed Jan 7, 2021
1 parent 1b9f096 commit 2cd41c8
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 9 deletions.
21 changes: 21 additions & 0 deletions docs/event_definitions/Nonprofit/Event/DiscountCode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { HoudiniObject, FlexibleAmount, IdType, HoudiniEvent } from "../../common";
import Nonprofit from '..';



export interface DiscountCode extends HoudiniObject, CreateDiscountCode {
event: IdType | Event;
id: IdType;
nonprofit: IdType | Nonprofit;
object: 'discount_code';
}

type DiscountDetails = { percent: number|string } | {flatAmount: FlexibleAmount}

export interface CreateDiscountCode {
code: string;
description: string;
discount: DiscountDetails;
}

export type DiscountCodeCreated = HoudiniEvent<'discount_code.created', DiscountCode>
12 changes: 10 additions & 2 deletions docs/event_definitions/Nonprofit/Event/TicketLevel.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
/* eslint-disable */

import { IdType, HoudiniObject, HoudiniEvent} from '../../common';
import { IdType, HoudiniObject, HoudiniEvent, Amount, FlexibleAmount} from '../../common';
import Event from './'

export interface TicketLevel extends HoudiniObject {
id: IdType;
name: string;
event: IdType | Event;

amount: Amount
limit?: number;
object: "ticket_level";
}


export interface CreateTicketLevel {
name: string;
amount: FlexibleAmount;
limit?:number;
adminOnly: boolean;
}


export type TicketLevelCreated = HoudiniEvent<'ticket_level.created', TicketLevel>;
3 changes: 2 additions & 1 deletion docs/event_definitions/Nonprofit/Supporter/Address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import Supporter from '.';
export default interface Address extends HoudiniObject {
city: string;
country: string;
id: IdType;
address: string;
postalCode: string;
stateCode: string;
supporter: IdType | Supporter;
object: 'supporter_address';
}

export interface CreateSupporterAddress {
address: string;
city: string;
country: string;
postalCode: string;
Expand Down
19 changes: 19 additions & 0 deletions docs/event_definitions/Nonprofit/Supporter/Tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable @typescript-eslint/member-ordering */
import { HoudiniEvent, HoudiniObject, IdType } from "../../common";
import Nonprofit from '..';



export interface TagMaster extends HoudiniObject {
object: 'tag_master';
nonprofit: IdType | Nonprofit;
value: string;
}


export interface CreateTagMaster {
value: string;
}


export type TagMasterCreated = HoudiniEvent<'tag_master.created', TagMaster>;
5 changes: 4 additions & 1 deletion docs/event_definitions/Nonprofit/Supporter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { IdType, HoudiniObject, HoudiniEvent } from '../../common';
import Nonprofit from '../';
import Address, { CreateSupporterAddress} from "./Address";
import { TagMaster } from './Tag';

/**
* @description An individuals
Expand All @@ -21,6 +22,8 @@ export default interface Supporter extends HoudiniObject {
deleted?: boolean;
merged_into?: IdType | Supporter
merged_on?: Date

tags?: IdType[]|TagMaster[]
}

/**
Expand All @@ -35,7 +38,7 @@ export interface CreateSupporter {
title: string;
organization?: string;
primary_address?: CreateSupporterAddress;
tags?:[]
tags?: IdType[]
}


Expand Down
47 changes: 43 additions & 4 deletions docs/event_definitions/Nonprofit/Transaction/TicketOrder.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
/* eslint-disable */
import { IdType, HoudiniObject } from '../../common';
import { Transaction } from './Transaction';

import Nonprofit from '..'
import { IdType, HoudiniObject, Amount, HoudiniEvent, FlexibleAmount } from '../../common';
import { TicketLevel } from '../Event/TicketLevel';
import Supporter from '../Supporter';

export interface TicketOrder extends HoudiniObject {
id: IdType;
object: "ticket_order";
event: IdType | Event;
nonprofit: IdType | Nonprofit;
supporter: IdType | Supporter;
/**
* the money that is associated with an online payment, such as a credit card purchase
*/
amount: Amount

/** the money that is associated with an offline payment */
amountAsOfflinePayment:Amount

transaction: IdType | Transaction;
discountCode: string|null

/**
* One ticket level for each ticket that they would like to buy of that level
*/
tickets: TicketLevel[];

}

export type TicketOrderCreated = HoudiniEvent<'ticket_order.created', TicketOrder>;


export interface CreateTicketOrder extends HoudiniObject {
object: "ticket_order"

supporter: IdType
/**
* the money that is associated with an online payment, such as a credit card purchase
*/
amount: FlexibleAmount

/** the money that is associated with an offline payment */
amountAsOfflinePayment:FlexibleAmount


discountCode: string|null
/**
* One ticket level for each ticket that they would like to buy of that level
*/
tickets: TicketLevel[];
}
6 changes: 5 additions & 1 deletion docs/event_definitions/Nonprofit/Transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ export default interface Transaction extends HoudiniObject {
nonprofit: IdType | Nonprofit;
supporter: IdType | Supporter;
status: "created" | "waiting" | "failed" | "completed";
items: CreateTransactionItem;

amount: Amount;
netAmount: Amount;
disputes:
refunds:


}

Expand Down

0 comments on commit 2cd41c8

Please sign in to comment.