· 6 years ago · Aug 22, 2019, 01:54 AM
1lib/app.ts:75:// TODO(cgag): need to start figuring out migrations by hand.
2lib/app.ts:76:// TODO(cgag): we have to keep all these firebase ids around because
3lib/dbTypes.ts:44:// TODO(cgag): why can this be empty string? that seems wrong
4lib/helpers/db-queries/affiliate-referrals.ts:6:// TODO(cgag): probably shouldn't only conditional return data, choose always or never
5lib/helpers/db-queries/affiliate-referrals.ts:7:// TODO(cgag): also shouldn't be modifying state of arguments
6lib/helpers/db-queries/affiliate-referrals.ts:100:// TODO(cgag): don't modify arguments
7lib/helpers/email/purchase-notification.ts:7:// TODO(cgag): emails are inconsistent in paramaeter order, make address
8lib/helpers/email/receipt.ts:5:// TODO(cgag): probably get rid of this, just a transitory
9lib/helpers/support/getUserCoinbaseOrders.ts:59:// TODO(cgag): too many functions don't have return types
10lib/helpers/support/refundDomains.ts:52: // TODO(cgag): what's going on here, won't this put a bunch of undefined's in here?J
11lib/middleware/__mocks__/authOnly.ts:7: // TODO(cgag): ^ but it probably shouldn't be
12lib/middleware/authOnly.ts:8: // TODO(cgag): ^ but it probably shouldn't be
13lib/model/order.ts:12:// TODO(cgag): do we need this purchase stuff at all or can we get it from domain owners?
14lib/model/order.ts:24:// TODO(cgag): this doesn't always actually set something in the db? is that right?
15lib/model/order.ts:46:// TODO(cgag): wait what, someetimes it returns a string and sometimes a promise?
16lib/model/order.ts:281: // TODO(cgag): woah, what are the semantics here? is this destructive
17lib/model/payment.ts:24:// TODO(cgag): goofy type, consider rewriting
18lib/model/user.ts:12:// TODO(cgag): need a type here
19lib/routes/mobile/domains/get.ts:41: // TODO(cgag): don't make types that are just arrays of other types
20lib/routes/payment/stripe/post-pg.test.ts:5:// TODO(cgag): delete? testing mocking
21lib/routes/payment/stripe/post-pg.test.ts:33:// TODO(cgag): some of this depends on having cloned unstoppable-dev to unstoppable-test
22lib/routes/payment/stripe/post-pg.test.ts:138: // TODO(cgag): is this sending out real emails to the business team?
23lib/routes/payment/stripe/post-pg.test.ts:146: // TODO(cgag): this has to match waht we put in the cart in beforeAll
24lib/routes/payment/stripe/post-pg.ts:39:// TODO(cgag): needs to be called with auth only
25lib/routes/payment/stripe/post-pg.ts:50:// TODO(cgag): should return error messages for each way it can go wrong.
26lib/routes/payment/stripe/post-pg.ts:77: // TODO(cgag): what the fuck is tokenId
27lib/routes/payment/stripe/post-pg.ts:81: // TODO(cgag): uh oh, createCharge uses tokenId, I don't really understand
28lib/routes/payment/stripe/post-pg.ts:92: // TODO(cgag): had to type this as any for my stupid test. What about with mocking?
29lib/routes/payment/stripe/post-pg.ts:119: // TODO(cgag): real error handling
30lib/routes/payment/stripe/post-pg.ts:125: // TODO(cgag): test with someone who actually has cart items
31lib/routes/payment/stripe/post-pg.ts:126: // TODO(cgag): should this just pass in items instead of user?
32lib/routes/payment/stripe/post-pg.ts:130: // TODO(cgag): use constructor?
33lib/routes/payment/stripe/post-pg.ts:151: // TODO(cgag): should we set/append user.orders or will it do it for us via cascae?
34lib/routes/payment/stripe/post-pg.ts:170: // TODO(cgag): error handling
35lib/routes/payment/stripe/post-pg.ts:186: // TODO(cgag): probably don't want tests hitting stripe or tracking apis...
36lib/routes/payment/stripe/post-pg.ts:201: // TODO(cgag): transaction (or rely on cascades, which have an implicit transaction)
37lib/routes/payment/stripe/post-pg.ts:208: // TODO(cgag): wait! never use referral code? always use affiliateInfo.code?
38lib/routes/payment/stripe/post-pg.ts:248: // an if guard. Don't know why. Don't have internet. TODO(cgag): find out later.
39lib/routes/payment/stripe/post-pg.ts:258: // TODO(cgag): does it matter if we use user.firebaseid vs user.id?
40lib/routes/payment/stripe/post-pg.ts:263: // TODO(cgag): email should never be null, it's nullable to to old fucked up data, fix that data,
41lib/routes/payment/stripe/post-pg.ts:290: // TODO(cgag): do this, donald changed it a bunch, no longer no what it should look like,
42lib/routes/payment/stripe/post-pg.ts:312:// TODO(cgag): never use function keyword since rest of the codebase doesn't
43lib/routes/payment/stripe/post-pg.ts:313:// TODO(cgag): how do we ensure the user we're passed was loaded
44lib/routes/payment/stripe/post-pg.ts:316:// TODO(cgag): have ryan confirm this logic is good
45lib/routes/payment/stripe/post-pg.ts:334:// TODO(cgag): break up this function?
46lib/routes/payment/stripe/post-pg.ts:335:// TODO(cgag): pass in a User
47lib/routes/payment/stripe/post-pg.ts:349: // TODO(cgag): how do we make guaranteees about loaded relations?
48lib/routes/payment/stripe/post-pg.ts:381: // TODO(cgag): why is this ending up as 0?
49lib/routes/payment/stripe/post-pg.ts:386: // TODO(cgag): rename this, i think it's like the amount we're going to use
50lib/routes/payment/stripe/post-pg.ts:398: // TODO(cgag): seems very sketchy to return a dfeault value, should throw an error
51lib/routes/payment/stripe/post-pg.ts:405: // TODO(cgag): why are these being returned?
52lib/routes/payment/stripe/post-pg.ts:412:// TODO(cgag): should probably live somewhere else
53lib/routes/payment/stripe/post.ts:81: // TODO(cgag): note, none of this actually does anything, it's just building up
54lib/routes/payment/stripe/post.ts:117: // TODO(cgag): ok, so we create the payment/order/etc info and then
55lib/routes/payment/stripe/post.ts:124: // TODO(cgag): use await
56lib/routes/payment/stripe/post.ts:182: // TODO(cgag): is there any reason this is below tracking?
57lib/routes/referrals/get.ts:9:// TODO(cgag): if this is supposed to be the response type, the response is wrong because
58lib/routes/user/profile/get.ts:19: // TODO(cgag): include everything in the Profile type from userAction
59lib/routes/user/profile/get.ts:24: // TODO(cgag): which relations do we need? definitely cart. only things
60lib/routes/user/profile/get.ts:26: // TODO(cgag): we can find them in the profile type the frontend expects.
61lib/routes/user/profile/get.ts:28: // TODO(cgag): don't recognize most of those keys though, which is strange,
62lib/routes/user/profile/get.ts:33: // TODO(cgag): watchlist almost certainly not in the right format
63pg/entity/AffiliateInfo.ts:15:// TODO(cgag): not 100% on this pattern
64pg/entity/AffiliateInfo.ts:18:// TODO(cgag): not clear this should be a table?
65pg/entity/AffiliateInfo.ts:19:// TODO(cgag): Though if so, perhaps this should
66pg/entity/AffiliateInfo.ts:40: // TODO(cgag): this should almost certainly be an enum
67pg/entity/AffiliateInfo.ts:41: // TODO(cgag): allowing null for now because there's at least one affiliate info that just as
68pg/entity/AffiliateInfo.ts:46: // TODO(cgag): really can't tell if we should be carrying these around or not
69pg/entity/AffiliateInfo.ts:50: // TODO(cgag): createdAt / updatedAt?
70pg/entity/AffiliateOrder.ts:13:// TODO(cgag): not 100% on this pattern
71pg/entity/AffiliateOrder.ts:37: // TODO(cgag): cascades?
72pg/entity/CartItem.ts:20:// TODO(cgag): should we call this something else?
73pg/entity/CartItem.ts:35: // TODO(cgag): should it point to a real domain object?
74pg/entity/CartItem.ts:40: // TODO(cgag): use a proper type for this, it's an enum
75pg/entity/CartItem.ts:44: // TODO(cgag): are there more columns?
76pg/entity/CartItem.ts:45: // TODO(cgag): User | null?
77pg/entity/CoinbaseCharge.ts:15:// TODO(cgag): uniques
78pg/entity/CoinbaseCharge.ts:58: // TODO(cgag): maybe move to pricing idk
79pg/entity/CoinbaseCharge.ts:62: // TODO(cgag): enum? laways 'charge'?
80pg/entity/Domain.ts:19:// TODO(cgag): not 100% on this pattern
81pg/entity/Domain.ts:33: // TODO(cgag): handle relations
82pg/entity/Domain.ts:43: // TODO(cgag): possibly limited to like 10 characters or something,
83pg/entity/Domain.ts:45: // TODO(cgag): probably index this
84pg/entity/Domain.ts:50: // // TODO(cgag): this should be a named type for sure.
85pg/entity/Domain.ts:56: // TODO(cgag): wait, we actually want it to be structred like the json was right, is
86pg/entity/Domain.ts:61: // TODO(cgag): when don't we want cascade:true?
87pg/entity/Domain.ts:62: // TODO(cgag): which side does cascade really belong on?
88pg/entity/Domain.ts:63: // TODO(cgag): is it one to one, why do we have both "owners" and "owner" for purchases?
89pg/entity/Domain.ts:64: // TODO(cgag): it's many to many, but we should change it back to ManyToOne if we can pending talks with ryan.
90pg/entity/Domain.ts:65: // TODO(cgag): !! for now, removing this and making "purchases" the source of truth for ownership?? not sure that's the bes tidea really.
91pg/entity/Domain.ts:77: // TODO(cgag): do a join to avoid doing 2 queries
92pg/entity/Order.ts:16:// TODO(cgag): not 100% on this pattern
93pg/entity/Order.ts:17:// TODO(cgag): implement
94pg/entity/Order.ts:27:// TODO(cgag): don't forget to put indexes on all the foreign keys
95pg/entity/Order.ts:31: // TODO(cgag): how do these New constructors work with relationships? can we pass an id?
96pg/entity/Order.ts:36: // TODO(cgag): why i bother checking these if they're nullable? just assign
97pg/entity/Order.ts:57: // TODO(cgag): all firebaseIds should almost certainly be nullable, go back
98pg/entity/Order.ts:62: // TODO(cgag): this appears to be a relation (a firebaes id pointing to a payment)
99pg/entity/Order.ts:66: // TODO(cgag): what encoding? big integer, convert to postgres type?
100pg/entity/Order.ts:67: // TODO(cgag): default to now? some are null in the original data though,
101pg/entity/Order.ts:69: // TODO(cgag): how the fuck? seems to work on import but new Date().getTime() is too big for
102pg/entity/Order.ts:71: // TODO(cgag): lol woops, it's null for all of them
103pg/entity/Order.ts:76: // TODO(cgag): should we just default to 0 instead of nullable?
104pg/entity/Order.ts:77: // TODO(cgag): How many are null? Why are they null?
105pg/entity/Order.ts:81: // TODO(cgag): should we keep this around or just have a relationh?
106pg/entity/Order.ts:89: // TODO(cgag): doesn't seem to be cascading?
107pg/entity/Order.ts:93: // TODO(cgag): is it nullable? add | null?
108pg/entity/OrderItem.ts:11:// TODO(cgag): not 100% on this pattern
109pg/entity/OrderItem.ts:21:// TODO(cgag): a before insert/save hook to validate that order is going to get set??
110pg/entity/OrderItem.ts:25: // TODO(cgag): how do these New constructors work with relationships? can we pass an id?
111pg/entity/OrderItem.ts:34: // TODO(cgag): !! ok big problem potentially. Explicitly setting order to null,
112pg/entity/OrderItem.ts:48: // TODO(cgag): enum, surely exists
113pg/entity/OrderItem.ts:52: // TODO(cgag): could point a domain
114pg/entity/OrderItem.ts:59: // TODO(cgag): enum, surely exists
115pg/entity/Payment.ts:11:// TODO(cgag): this type won't live in this old model eventually
116pg/entity/Payment.ts:16:// TODO(cgag): not 100% on this pattern
117pg/entity/Payment.ts:21: // TODO(cgag): how do these New constructors work with relationships? can we pass an id?
118pg/entity/Payment.ts:35: // TODO(cgag): should definitely be an int but do we do that? how does
119pg/entity/Payment.ts:40: // TODO(cgag): should probably be called location (same with method, and perhaps the type names)
120pg/entity/Payment.ts:44: // TODO(cgag): make it non-nullable and default to 0?
121pg/entity/Payment.ts:54: // TODO(cgag): should we hold on to payment_user_firebase_id?
122pg/entity/Payment.ts:60: // TODO(cgag): relation, in json it's a firebase id, convert to postgres id.
123pg/entity/Payment.ts:65: // TODO(cgag): created/updatedat columns
124pg/entity/Purchase.ts:15:// TODO(cgag): not 100% on this pattern
125pg/entity/Purchase.ts:31: // TODO(cgag): use jblows @tag system or something, just making
126pg/entity/Purchase.ts:33: // TODO(cgag): implement me
127pg/entity/Purchase.ts:40: // TODO(cgag): give this enum a name somewhere, probably has one somewhere
128pg/entity/Purchase.ts:44: // TODO(cgag): why is this shere?
129pg/entity/Record.ts:12:// TODO(cgag): not 100% on this pattern
130pg/entity/Record.ts:18:// TODO(cgag): really hate types coming thr
131pg/entity/Record.ts:19:// TODO(cgag): some records have blank values, should that actually be allowed?
132pg/entity/Record.ts:22: // TODO(cgag): should it take a domain?
133pg/entity/Record.ts:33: // TODO(cgag): unsure on naming here, just key / value?
134pg/entity/Record.ts:40: // TODO(cgag): belongs to domain
135pg/entity/Record.ts:41: // TODO(cgag): cascades and such
136pg/entity/Record.ts:46: // TODO(cgag): does it being a foreign key imply not null?
137pg/entity/Referral.ts:12:// // TODO(cgag): not 100% on this pattern
138pg/entity/Referral.ts:25:// // TODO(cgag): maybe?
139pg/entity/Referral.ts:29:// // TODO(cgag): what is this really? affiliate_code?
140pg/entity/Referral.ts:35:// // TODO(cgag): createdAt / updatedAt?
141pg/entity/User.ts:31: // TODO(cgag): relations??
142pg/entity/User.ts:35:// TODO(cgag): validations and check constraints
143pg/entity/User.ts:39:// TODO(cgag): doesn't work, we have dupes, probably very bad?
144pg/entity/User.ts:45: // TODO(cgag): do something once we know what all
145pg/entity/User.ts:57: // TODO(cgag): ok, so we already have a ton of firebase ids floating around,
146pg/entity/User.ts:62: // TODO(cgag): add these created/updated columns to all entities?
147pg/entity/User.ts:69: // TODO(cgag): should be nullable?
148pg/entity/User.ts:74: // TODO(cgag): when can this be null? surely everyone has an email? there appear to be 8 users without
149pg/entity/User.ts:76: // TODO(cgag): ryan confirms it shouldn't be null and their emails are in firebase auth. Can we just delete them or should we
150pg/entity/User.ts:87: // TODO(cgag): I think it's safe to default this to false. It's never false in firebase,
151pg/entity/User.ts:92: // TODO(cgag): this one's nullable, or empty stringable at least,
152pg/entity/User.ts:94: // TODO(cgag): surely if it's nullable, the type should be string | null
153pg/entity/User.ts:98: // TODO(cgag): nullable / not empty?
154pg/entity/User.ts:99: // TODO(cgag): should it be | null, or should it be an optional key?
155pg/entity/User.ts:103: // TODO(cgag): nullable / not empty?
156pg/entity/User.ts:104: // TODO(cgag): what happens when you have nullable true, but the type is incorrectly just a string?
157pg/entity/User.ts:105: // TODO(cgag): try underscores or look into implementing / existing naming strategies
158pg/entity/User.ts:109: // TODO(cgag): primary key address here or as it's own table?
159pg/entity/User.ts:110: // TODO(cgag): should probably be "Domain[] | null". Why is it like this? why not empty?
160pg/entity/User.ts:124: // TODO(cgag): seems like it should just be called user, sticking with owner
161pg/entity/User.ts:129: // TODO(cgag): need to review cascades for basically everything
162pg/entity/WatchlistItem.ts:18:// TODO(cgag): does this object even need to exit? has many through?
163scripts/pg-import/prototyping.ts:25:// TODO(cgag): all this code assumes the db is empty, perhaps unacceptable. Make it safe to run multiple times?
164scripts/pg-import/prototyping.ts:28: // TODO(cgag): apparently type_orm by default uses stupid column names with capital leters
165scripts/pg-import/prototyping.ts:32: // TODO(cgag): how are these the same?
166scripts/pg-import/prototyping.ts:120: // TODO(cgag): why is this necessary?
167scripts/pg-import/prototyping.ts:151:// TODO(cgag): breaking stuff up doesn't work so well because everything is really
168scripts/pg-import/prototyping.ts:153:// TODO(cgag): !! If we're going to do this incrementally, then we need to be able to run
169scripts/pg-import/prototyping.ts:155:// TODO(cgag): worth tackling early?
170scripts/pg-import/prototyping.ts:164: // TODO(cgag): should normally never build objects without using the constructor,
171scripts/pg-import/prototyping.ts:189: // TODO(cgag): write some code or us jq to figure out if there are keys we're not handling.
172scripts/pg-import/prototyping.ts:191: // TODO(cgag): ok, so it's claiming to have saved users, but what the hell, where are they?
173scripts/pg-import/prototyping.ts:192: // ^ TODO(cgag): what the hell, if you do select * from user, you get just postgres, you have to
174scripts/pg-import/prototyping.ts:232: // TODO(cgag): could chunk this stuff below too
175scripts/pg-import/prototyping.ts:234: // TODO(cgag): if we care, optimize by batch looking up users / domains,
176scripts/pg-import/prototyping.ts:236: // TODO(cgag): use label to lookup a domain and point to it
177scripts/pg-import/prototyping.ts:243: // TODO(cgag): there only seems to be one, I don't remember
178scripts/pg-import/prototyping.ts:250: // TODO(cgag): need to turn on post slow query log and figure out what's goin on,
179scripts/pg-import/prototyping.ts:258: // TODO(cgag): probably a cleaner way to do this without temporary variables?
180scripts/pg-import/prototyping.ts:270: // TODO(cgag): how big of a problem is this, what do we do about the guy
181scripts/pg-import/prototyping.ts:291: // TODO(cgag): the pathing is unpredicable based on where you run the command from i think,
182scripts/pg-import/prototyping.ts:302: // TODO(cgag): what if there's a record but not a corresponding domain in purchases? is that ok?
183scripts/pg-import/prototyping.ts:304: // TODO(cgag): maybe there are domains in the puarches table that have no records, so we're missing them?
184scripts/pg-import/prototyping.ts:315: // TODO(cgag): perhaps all the code that needs the owner should pull it out of
185scripts/pg-import/prototyping.ts:317: // TODO(cgag): what is the pending key under owners about, when is it used?
186scripts/pg-import/prototyping.ts:320: // TODO(cgag): this is how the code works in the actual app,
187scripts/pg-import/prototyping.ts:332: // TODO(cgag): what should we do here?
188scripts/pg-import/prototyping.ts:334: // TODO(cgag): what now??
189scripts/pg-import/prototyping.ts:335: // TODO(cgag): just create the domain with no purchase, right?
190scripts/pg-import/prototyping.ts:341: // TODO(cgag): none of them have an owner, what?
191scripts/pg-import/prototyping.ts:345: // TODO(cgag): doesn't include records by default, need eager loading explicitly, maybe we can
192scripts/pg-import/prototyping.ts:360: // TODO(cgag): so it turns out there's like 7 payments thare are nested under
193scripts/pg-import/prototyping.ts:371: // TODO(cgag): handle these. how many are there? why are they? default to 0? delete them?
194scripts/pg-import/prototyping.ts:380: // TODO(cgag): can't just skip this, handle it
195scripts/pg-import/prototyping.ts:391: // TODO(cgag): shouldn't need this 'if', but we're no longer throwing (temporarily)
196scripts/pg-import/prototyping.ts:411:// TODO(cgag): what if one of them has a key we didn't notice.
197scripts/pg-import/prototyping.ts:431: // TODO(cgag): is it right to ignore this?
198scripts/pg-import/prototyping.ts:445: // TODO(cgag): it'd be a lot faster to have a separate order-item import
199scripts/pg-import/prototyping.ts:447: // TODO(cgag): actually, maybe we don't have ot save here at all since we cascade?
200scripts/pg-import/prototyping.ts:450: // TODO(cgag): perhaps this should be nullable
201scripts/pg-import/prototyping.ts:466: // TODO(cgag): what do we do here?
202scripts/pg-import/prototyping.ts:479: // TODO(cgag): this if should be unecesssary but we're not exiting on unfound
203scripts/pg-import/prototyping.ts:492: // TODO(cgag): why is this insanely slow, because it has to go update orer items? how can we do it quickly?
204scripts/pg-import/prototyping.ts:500:// TODO(cgag): need to do this for for stripe/post.
205scripts/pg-import/prototyping.ts:501:// TODO(cgag): woops, actually connect domains to users before doing this
206scripts/pg-import/prototyping.ts:531:// TODO(cgag): ^^^ well, talk to ryan about the two without a tier (check the db for codes)
207scripts/pg-import/prototyping.ts:533:// TODO(cgag): !!!! why isn't code "nye" in the results? probably means
208scripts/pg-import/prototyping.ts:535:// TODO(cgag): need to handle orders, should it be here or another function?
209scripts/pg-import/prototyping.ts:546: // TODO(cgag): so how do we handle the no affiliate id ones??
210scripts/pg-import/prototyping.ts:559: // TODO(cgag): what if we don't have a userId? are we handling htatcorrectly?
211scripts/pg-import/prototyping.ts:607: // TODO(cgag): talk to ryan about why some of these may have no userId
212scripts/pg-import/prototyping.ts:619: // TODO(cgag): there are a decent amount of them
213scripts/pg-import/prototyping.ts:620: // TODO(cgag): what the hell, one of them has the userId as "thatmartiniguywy@gmail.com"
214scripts/pg-import/prototyping.ts:621: // TODO(cgag): we should probably save the user id in a field life old_user_id or something
215scripts/pg-import/prototyping.ts:654: // TODO(cgag): user is OneToOne relationship but we're hitting a duplicate error, apparently
216scripts/pg-import/prototyping.ts:689: // // TODO(cgag): ok, welp, think this whole script is wrong and the watchlist
217scripts/pg-import/prototyping.ts:696: // // TODO(cgag): find or create?
218scripts/pg-import/prototyping.ts:710: // // TODO(cgag): this is definitely going to slow
219scripts/pg-import/prototyping.ts:767: // TODO(cgag): there are 5 degenerate cases with no code,
220scripts/pg-import/prototyping.ts:789:// TODO(cgag): why does this take so long to exit after main returns?