iaa 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47702542829dfefc3e317e0c13a36ad3633282a5
4
- data.tar.gz: 890134742cec065c4122d93c327f76e18b96ee01
3
+ metadata.gz: 1eb2158ff489e1ffc1e98abbbfde98270da163df
4
+ data.tar.gz: 8d517d819226ed638327487157eeeb27f254305c
5
5
  SHA512:
6
- metadata.gz: daaaa4ee1deaf51d043ac4c12be24a94a50ea9fd5c8767beaa46b7ffcc69a212bcadce1ef1e8c59a2b8991a27b84a1d19928a52e75a850f7fa0d15aa2af69f8f
7
- data.tar.gz: 6330f2f22b5610557051f2b8e588c7cf11130de88bb6c6a199dc3da2a438c18df79d87f36fc25ba1f3a06ce70438e57437cbc43b2dd2cab8adbaa2804f930f04
6
+ metadata.gz: 88fc95a42dc2016886f7f283a976f6d06070f7da731a3c0405f79ca332578ca4924b517a5f32fc1f725ea57cea9f9a34410c94719c3f66d1d95b8eaaf7a56df6
7
+ data.tar.gz: ac3590c159a1d5793af5d63aba8e3a6cb53a77073e56208bc6456058fba0f34bc151b6919f4b09cb5319e0b60759d00ee39cde62cfbae9aab9f9a06a5d50a5fb
data/README.md CHANGED
@@ -56,11 +56,27 @@ form2.start_date = "07-07-2016"
56
56
  form.save('/path/to/save/destination')
57
57
  ```
58
58
 
59
- See `lib/form_7600a.rb` and `lib/form_7600b` for all getter and setter methods.
59
+ See `lib/mappings/7600A.json` and `lib/mappings/7600A.json` for all getter and setter methods. The field in these files called `"attribute_name"` corresponds to all getter and setter method names. For example in `lib/mappings/7600A.json`, we have:
60
+
61
+ ```json
62
+ // ...
63
+ {
64
+ "name": "Start Date",
65
+ "attribute_name": "start_date",
66
+ "options": null,
67
+ "type": "Text",
68
+ "value": "FILL IN"
69
+ },
70
+ // ...
71
+ ```
72
+
73
+ This means instances of `IAA::Form7600A` have the methdods `#start_date` and `#start_date=`. All of the methods are created during `::initialize` through some metaprogramming. Think of the JSON files in the `mappings` folder as the canonical source of method names.
74
+
75
+ You could also use these JSON files to create IAA form fillers in other languages.
60
76
 
61
- ### mappings.json
77
+ ### PDFs
62
78
 
63
- This repo provides a JSON file for each form (`lib/mappings/7600A.json` and `lib/mappings/7600B.json`) of all form fields including their types and possible values (e.g. for radio buttons and checkboxes). This could be used to map objects in other languages to the IAA Form 7600A.
79
+ The PDFs in `lib/pdfs` have been modified somewhat from their originals. Visually, nothing has changed, but a few of the underlying form field names have been changed. For example, one field, "GT & C #" caused a lot of trouble because of that pesky ampersand. So, the field value in the PDF was changed to "gt_and_c_number".
64
80
 
65
81
  ## Docker Compose Usage
66
82
 
@@ -68,24 +84,7 @@ This repo provides a JSON file for each form (`lib/mappings/7600A.json` and `lib
68
84
  2. Navigate to iaa-gem directory and run `docker-compose build`.
69
85
  3. Run `docker-compose run iaa`.
70
86
 
71
- ## Caveats
72
-
73
- Currently, the following fields cannot be set:
74
-
75
- ### Form 7600A
76
87
 
77
- - gt_and_c_number
78
- - general_explanation_overhead_fees_and_charges
79
- - number_of_days_this_iaa_may_be_terminated
80
-
81
- ### Form 7600B
82
-
83
- - gt_and_c_number
84
- - requesting_agency_a
85
- - servicing_agency_a
86
- - overhead_fees_and_charges
87
-
88
- See https://github.com/18F/iaa-gem/issues/6.
89
88
 
90
89
  ## Development
91
90
 
@@ -96,3 +95,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
96
95
  ## Contributing
97
96
 
98
97
  Bug reports and pull requests are welcome on GitHub at https://github.com/18F/iaa-gem.
98
+
data/lib/base_form.rb CHANGED
@@ -8,9 +8,10 @@ module IAA
8
8
  def init_pdftk(pdftk_path)
9
9
  PdfForms.new(pdftk_path || Cliver.detect('pdftk'))
10
10
  end
11
-
11
+
12
12
  def get_mapper_fields(path)
13
- JSON.parse(File.read(path))
13
+ full_path = File.expand_path(File.join('..', '..', path), __FILE__)
14
+ JSON.parse(File.read(full_path))
14
15
  end
15
16
 
16
17
  def load_fields_from_pdf!(pdf_path, pdftk, form_object)
@@ -29,6 +30,18 @@ module IAA
29
30
  @fill_values = {}
30
31
  load_fields_from_pdf!(pdf_path, @pdftk, self)
31
32
  @pdf_path = pdf_path || self.class.default_pdf_path
33
+
34
+ @fields.each do |field|
35
+ self.class.send(:define_method, field['attribute_name']) do
36
+ get_attr(field['name'])
37
+ end
38
+ end
39
+
40
+ @fields.each do |field|
41
+ self.class.send(:define_method, "#{field['attribute_name']}=") do |argument|
42
+ set_attr(field['name'], argument)
43
+ end
44
+ end
32
45
  end
33
46
 
34
47
  def read_fields
data/lib/form_7600a.rb CHANGED
@@ -3,390 +3,5 @@ module IAA
3
3
  def self.form_name
4
4
  "7600A"
5
5
  end
6
-
7
- def servicing_agency_tracking_number=(new_servicing_agency_tracking_number)
8
- set_attr("Servicing Agency Agreement Tracking Number (Optional)", new_servicing_agency_tracking_number)
9
- end
10
-
11
- def servicing_agency_tracking_number
12
- get_attr("Servicing Agency Agreement Tracking Number (Optional)")
13
- end
14
-
15
- def start_date=(new_start_date)
16
- set_attr("Start Date", new_start_date)
17
- end
18
-
19
- def start_date
20
- get_attr("Start Date")
21
- end
22
-
23
- def end_date=(new_end_date)
24
- set_attr("End Date", new_end_date)
25
- end
26
-
27
- def end_date
28
- get_attr("End Date")
29
- end
30
-
31
- def requesting_agency_name=(new_requesting_agency_name)
32
- set_attr("Name Requesting Agency of Products/Services", new_requesting_agency_name)
33
- end
34
-
35
- def requesting_agency_name
36
- get_attr("Name Requesting Agency of Products/Services")
37
- end
38
-
39
- def requesting_agency_address=(new_requesting_agency_address)
40
- set_attr("Address Requesting Agency of Products/Services", new_requesting_agency_address)
41
- end
42
-
43
- def requesting_agency_address
44
- get_attr("Address Requesting Agency of Products/Services")
45
- end
46
-
47
- def servicing_agency_name=(new_servicing_agency_name)
48
- set_attr("Name Servicing Agency Providing Products/Services", new_servicing_agency_name)
49
- end
50
-
51
- def servicing_agency_name
52
- get_attr("Name Servicing Agency Providing Products/Services")
53
- end
54
-
55
- def servicing_agency_address=(new_servicing_agency_address)
56
- set_attr("Address Servicing Agency Providing Products/Services", new_servicing_agency_address)
57
- end
58
-
59
- def servicing_agency_address
60
- get_attr("Address Servicing Agency Providing Products/Services")
61
- end
62
-
63
- def radio1=(new_radio1)
64
- set_attr("Radio Button1", new_radio1)
65
- end
66
-
67
- def radio1
68
- get_attr("Radio Button1")
69
- end
70
-
71
- def radio2=(new_radio2)
72
- set_attr("Radio Button2", new_radio2)
73
- end
74
-
75
- def radio2
76
- get_attr("Radio Button2")
77
- end
78
-
79
- def radio3=(new_radio3)
80
- set_attr("Radio Button3", new_radio3)
81
- end
82
-
83
- def radio3
84
- get_attr("Radio Button3")
85
- end
86
-
87
- def radio4=(new_radio4)
88
- set_attr("Radio Button4", new_radio4)
89
- end
90
-
91
- def radio4
92
- get_attr("Radio Button4")
93
- end
94
-
95
- def radio5=(new_radio5)
96
- set_attr("Radio Button5", new_radio5)
97
- end
98
-
99
- def radio5
100
- get_attr("Radio Button5")
101
- end
102
-
103
- def radio6=(new_radio6)
104
- set_attr("Radio Button6", new_radio6)
105
- end
106
-
107
- def radio6
108
- get_attr("Radio Button6")
109
- end
110
-
111
- def amendment=(new_amendment)
112
- set_attr("Amendment", new_amendment)
113
- end
114
-
115
- def amendment
116
- get_attr("Amendment")
117
- end
118
-
119
- def cancellation_explanation=(new_cancellation_explanation)
120
- set_attr("IAA Cancellation Explanation", new_cancellation_explanation)
121
- end
122
-
123
- def cancellation_explanation
124
- get_attr("IAA Cancellation Explanation")
125
- end
126
-
127
- def other_renewal_period=(new_other_renewal_period)
128
- set_attr("Other Renewal Period", new_other_renewal_period)
129
- end
130
-
131
- def other_renewal_period
132
- get_attr("Other Renewal Period")
133
- end
134
-
135
- def requesting_agency_statutory_authority_title_and_citation=(new_requesting_agency_statutory_authority_title_and_citation)
136
- set_attr("Requesting Agency's Statutory Authority Title and Citation", new_requesting_agency_statutory_authority_title_and_citation)
137
- end
138
-
139
- def requesting_agency_statutory_authority_title_and_citation
140
- get_attr("Requesting Agency's Statutory Authority Title and Citation")
141
- end
142
-
143
- def gt_and_c_number=(new_gt_and_c_number)
144
- set_attr("GT&C #", new_gt_and_c_number)
145
- end
146
-
147
- def gt_and_c_number
148
- get_attr("GT&C #")
149
- end
150
-
151
- def mod_number=(new_mod_number)
152
- set_attr("Mod #", new_mod_number)
153
- end
154
-
155
- def mod_number
156
- get_attr("Mod #")
157
- end
158
-
159
- def direct_cost=(new_direct_cost)
160
- set_attr("Direct Cost", new_direct_cost)
161
- end
162
-
163
- def direct_cost
164
- get_attr("Direct Cost")
165
- end
166
-
167
- def overhead_fees_and_charges=(new_overhead_fees_and_charges)
168
- set_attr("Overhead Fees Charges", new_overhead_fees_and_charges)
169
- end
170
-
171
- def overhead_fees_and_charges
172
- get_attr("Overhead Fees Charges")
173
- end
174
-
175
- def total_estimated_amount=(new_total_estimated_amount)
176
- set_attr("Total Estimated Amount", new_total_estimated_amount)
177
- end
178
-
179
- def total_estimated_amount
180
- get_attr("Total Estimated Amount")
181
- end
182
-
183
- def requesting_agency_scope=(new_requesting_agency_scope)
184
- set_attr("11 Requesting Agencys Scope State andor list attachments that support Requesting Agencys Scope", new_requesting_agency_scope)
185
- end
186
-
187
- def requesting_agency_scope
188
- get_attr("11 Requesting Agencys Scope State andor list attachments that support Requesting Agencys Scope")
189
- end
190
-
191
- def requesting_agency_roles_and_responsibilities=(new_requesting_agency_roles_and_responsibilities)
192
- set_attr("12 Roles Responsibilities for the Requesting Agency and Servicing Agency State andor list attachments for the roles and responsibilities for the Requesting Agency and the Servicing Agency", new_requesting_agency_roles_and_responsibilities)
193
- end
194
-
195
- def requesting_agency_roles_and_responsibilities
196
- get_attr("12 Roles Responsibilities for the Requesting Agency and Servicing Agency State andor list attachments for the roles and responsibilities for the Requesting Agency and the Servicing Agency")
197
- end
198
-
199
- def radio7=(new_radio7)
200
- set_attr("Radio Button7", new_radio7)
201
- end
202
-
203
- def radio7
204
- get_attr("Radio Button7")
205
- end
206
-
207
- def radio8=(new_radio8)
208
- set_attr("Radio Button8", new_radio8)
209
- end
210
-
211
- def radio8
212
- get_attr("Radio Button8")
213
- end
214
-
215
- def general_explanation_overhead_fees_and_charges=(new_general_explanation_overhead_fees_and_charges)
216
- set_attr("General Explanation Overhead Fees & Charges", new_general_explanation_overhead_fees_and_charges)
217
- end
218
-
219
- def general_explanation_overhead_fees_and_charges
220
- get_attr("General Explanation Overhead Fees & Charges")
221
- end
222
-
223
- def statory_authority=(new_statory_authority)
224
- set_attr("Statutory authority", new_statory_authority)
225
- end
226
-
227
- def statory_authority
228
- get_attr("Statutory authority")
229
- end
230
-
231
- def statutory_authority_1=(new_statutory_authority_1)
232
- set_attr("Statutory Authority1", new_statutory_authority_1)
233
- end
234
-
235
- def statutory_authority_1
236
- get_attr("Statutory Authority1")
237
- end
238
-
239
- def restrictions=(new_restrictions)
240
- set_attr("13 Restrictions Optional State andor attach unique requirements andor mission specific restrictions specific to this IAA", new_restrictions)
241
- end
242
-
243
- def restrictions
244
- get_attr("13 Restrictions Optional State andor attach unique requirements andor mission specific restrictions specific to this IAA")
245
- end
246
-
247
- def requesting_agency_organiations_authorized=(new_requesting_agency_organiations_authorized)
248
- set_attr("17 Assisted Acquisition Agreements Requesting Agencys Organizations Authorized To Request Acquisition Assistance for this IAA State or attach a list of Requesting Agencys organizations authorized to request acquisition assistance for this IAA", new_requesting_agency_organiations_authorized)
249
- end
250
-
251
- def requesting_agency_organiations_authorized
252
- get_attr("17 Assisted Acquisition Agreements Requesting Agencys Organizations Authorized To Request Acquisition Assistance for this IAA State or attach a list of Requesting Agencys organizations authorized to request acquisition assistance for this IAA")
253
- end
254
-
255
- def servicing_agency_organiations=(new_servicing_agency_organiations)
256
- set_attr("18 Assisted Acquisition Agreements Servicing Agencys Organizations authorized to Provide Acquisition Assistance for this IAA State or attach a list of Servicing Agencys organizations authorized to provide acquisition for this IAA", new_servicing_agency_organiations)
257
- end
258
-
259
- def servicing_agency_organiations
260
- get_attr("18 Assisted Acquisition Agreements Servicing Agencys Organizations authorized to Provide Acquisition Assistance for this IAA State or attach a list of Servicing Agencys organizations authorized to provide acquisition for this IAA")
261
- end
262
-
263
- def requesting_agency_clauses=(new_requesting_agency_clauses)
264
- set_attr("19 Requesting Agency Clauses Optional State andor attach any additional Requesting Agency clauses", new_requesting_agency_clauses)
265
- end
266
-
267
- def requesting_agency_clauses
268
- get_attr("19 Requesting Agency Clauses Optional State andor attach any additional Requesting Agency clauses")
269
- end
270
-
271
- def number_of_days_this_iaa_may_be_terminated=(new_number_of_days_this_iaa_may_be_terminated)
272
- set_attr("No. of days this IAA may be terminated", new_number_of_days_this_iaa_may_be_terminated)
273
- end
274
-
275
- def number_of_days_this_iaa_may_be_terminated
276
- get_attr("No. of days this IAA may be terminated")
277
- end
278
-
279
- def servicing_agency_clauses=(new_servicing_agency_clauses)
280
- set_attr("20 Servicing Agency Clauses Optional State andor attach any additional Servicing Agency clauses", new_servicing_agency_clauses)
281
- end
282
-
283
- def servicing_agency_clauses
284
- get_attr("20 Servicing Agency Clauses Optional State andor attach any additional Servicing Agency clauses")
285
- end
286
-
287
- def additional_attachments=(new_additional_attachments)
288
- set_attr("21 Additional Requesting Agency andor Servicing Agency Attachments Optional State andor attach any additional Requesting Agency andor Servicing Agency attachments", new_additional_attachments)
289
- end
290
-
291
- def additional_attachments
292
- get_attr("21 Additional Requesting Agency andor Servicing Agency Attachments Optional State andor attach any additional Requesting Agency andor Servicing Agency attachments")
293
- end
294
-
295
- def requesting_agency_name=(new_requesting_agency_name)
296
- set_attr("Requesting Agency Name", new_requesting_agency_name)
297
- end
298
-
299
- def requesting_agency_name
300
- get_attr("Requesting Agency Name")
301
- end
302
-
303
- def servicing_agency_name=(new_servicing_agency_name)
304
- set_attr("Servicing Agency Name", new_servicing_agency_name)
305
- end
306
-
307
- def servicing_agency_name
308
- get_attr("Servicing Agency Name")
309
- end
310
-
311
- def requesting_agency_title=(new_requesting_agency_title)
312
- set_attr("Requesting Agency Title", new_requesting_agency_title)
313
- end
314
-
315
- def requesting_agency_title
316
- get_attr("Requesting Agency Title")
317
- end
318
-
319
- def servicing_agency_title=(new_servicing_agency_title)
320
- set_attr("Servicing Agency Title", new_servicing_agency_title)
321
- end
322
-
323
- def servicing_agency_title
324
- get_attr("Servicing Agency Title")
325
- end
326
-
327
- def requesting_agency_telephone_number=(new_requesting_agency_telephone_number)
328
- set_attr("Requesting Agency Telephone Number", new_requesting_agency_telephone_number)
329
- end
330
-
331
- def requesting_agency_telephone_number
332
- get_attr("Requesting Agency Telephone Number")
333
- end
334
-
335
- def servicing_agency_telephone_number=(new_servicing_agency_telephone_number)
336
- set_attr("Servicing Agency Telephone Number", new_servicing_agency_telephone_number)
337
- end
338
-
339
- def servicing_agency_telephone_number
340
- get_attr("Servicing Agency Telephone Number")
341
- end
342
-
343
- def requesting_agency_fax_number=(new_requesting_agency_fax_number)
344
- set_attr("Requesting Agency Fax Number", new_requesting_agency_fax_number)
345
- end
346
-
347
- def requesting_agency_fax_number
348
- get_attr("Requesting Agency Fax Number")
349
- end
350
-
351
- def servicing_agency_fax_number=(new_servicing_agency_fax_number)
352
- set_attr("Servicing Agency Fax Number", new_servicing_agency_fax_number)
353
- end
354
-
355
- def servicing_agency_fax_number
356
- get_attr("Servicing Agency Fax Number")
357
- end
358
-
359
- def requesting_agency_email_address=(new_requesting_agency_email_address)
360
- set_attr("Requesting Agency Email Address", new_requesting_agency_email_address)
361
- end
362
-
363
- def requesting_agency_email_address
364
- get_attr("Requesting Agency Email Address")
365
- end
366
-
367
- def servicing_agency_email_address=(new_servicing_agency_email_address)
368
- set_attr("Servicing Agency Email Address", new_servicing_agency_email_address)
369
- end
370
-
371
- def servicing_agency_email_address
372
- get_attr("Servicing Agency Email Address")
373
- end
374
-
375
- def requesting_agency_approval_date=(new_requesting_agency_approval_date)
376
- set_attr("Requesting Agency Approval Date", new_requesting_agency_approval_date)
377
- end
378
-
379
- def requesting_agency_approval_date
380
- get_attr("Requesting Agency Approval Date")
381
- end
382
-
383
- def servicing_agency_approval_date=(new_servicing_agency_approval_date)
384
- set_attr("Servicing Agency Approval Date", new_servicing_agency_approval_date)
385
- end
386
-
387
- def servicing_agency_approval_date
388
- get_attr("Servicing Agency Approval Date")
389
- end
390
-
391
6
  end
392
7
  end