|
588 | 588 | } |
589 | 589 |
|
590 | 590 |
|
| 591 | +# Nested schemas for Grant fields |
| 592 | +CFDA_NUMBER_SCHEMA: dict[str, FieldSchema] = { |
| 593 | + "number": FieldSchema(name="number", type=str, is_optional=True, is_list=False), |
| 594 | + "title": FieldSchema(name="title", type=str, is_optional=True, is_list=False), |
| 595 | +} |
| 596 | + |
| 597 | +CODE_DESCRIPTION_SCHEMA: dict[str, FieldSchema] = { |
| 598 | + "code": FieldSchema(name="code", type=str, is_optional=True, is_list=False), |
| 599 | + "description": FieldSchema(name="description", type=str, is_optional=True, is_list=False), |
| 600 | +} |
| 601 | + |
| 602 | +GRANT_ATTACHMENT_SCHEMA: dict[str, FieldSchema] = { |
| 603 | + "attachment_id": FieldSchema(name="attachment_id", type=str, is_optional=True, is_list=False), |
| 604 | + "mime_type": FieldSchema(name="mime_type", type=str, is_optional=True, is_list=False), |
| 605 | + "name": FieldSchema(name="name", type=str, is_optional=True, is_list=False), |
| 606 | + "posted_date": FieldSchema(name="posted_date", type=datetime, is_optional=True, is_list=False), |
| 607 | + "resource_id": FieldSchema(name="resource_id", type=str, is_optional=True, is_list=False), |
| 608 | + "type": FieldSchema(name="type", type=str, is_optional=True, is_list=False), |
| 609 | + "url": FieldSchema(name="url", type=str, is_optional=True, is_list=False), |
| 610 | +} |
| 611 | + |
| 612 | +GRANT_SCHEMA: dict[str, FieldSchema] = { |
| 613 | + "agency_code": FieldSchema(name="agency_code", type=str, is_optional=True, is_list=False), |
| 614 | + "applicant_eligibility_description": FieldSchema( |
| 615 | + name="applicant_eligibility_description", type=str, is_optional=True, is_list=False |
| 616 | + ), |
| 617 | + "description": FieldSchema(name="description", type=str, is_optional=True, is_list=False), |
| 618 | + "funding_activity_category_description": FieldSchema( |
| 619 | + name="funding_activity_category_description", type=str, is_optional=True, is_list=False |
| 620 | + ), |
| 621 | + "grant_id": FieldSchema(name="grant_id", type=int, is_optional=False, is_list=False), |
| 622 | + "grantor_contact": FieldSchema( |
| 623 | + name="grantor_contact", type=dict, is_optional=True, is_list=True |
| 624 | + ), |
| 625 | + "last_updated": FieldSchema( |
| 626 | + name="last_updated", type=datetime, is_optional=True, is_list=False |
| 627 | + ), |
| 628 | + "opportunity_number": FieldSchema( |
| 629 | + name="opportunity_number", type=str, is_optional=False, is_list=False |
| 630 | + ), |
| 631 | + "status": FieldSchema( |
| 632 | + name="status", type=dict, is_optional=True, is_list=False, nested_model="CodeDescription" |
| 633 | + ), |
| 634 | + "title": FieldSchema(name="title", type=str, is_optional=False, is_list=False), |
| 635 | + # Expanded fields |
| 636 | + "cfda_numbers": FieldSchema( |
| 637 | + name="cfda_numbers", |
| 638 | + type=dict, |
| 639 | + is_optional=True, |
| 640 | + is_list=True, |
| 641 | + nested_model="CFDANumber", |
| 642 | + ), |
| 643 | + "applicant_types": FieldSchema( |
| 644 | + name="applicant_types", |
| 645 | + type=dict, |
| 646 | + is_optional=True, |
| 647 | + is_list=True, |
| 648 | + nested_model="CodeDescription", |
| 649 | + ), |
| 650 | + "category": FieldSchema( |
| 651 | + name="category", type=dict, is_optional=True, is_list=False, nested_model="CodeDescription" |
| 652 | + ), |
| 653 | + "funding_categories": FieldSchema( |
| 654 | + name="funding_categories", |
| 655 | + type=dict, |
| 656 | + is_optional=True, |
| 657 | + is_list=True, |
| 658 | + nested_model="CodeDescription", |
| 659 | + ), |
| 660 | + "funding_details": FieldSchema( |
| 661 | + name="funding_details", type=dict, is_optional=True, is_list=True |
| 662 | + ), |
| 663 | + "funding_instruments": FieldSchema( |
| 664 | + name="funding_instruments", |
| 665 | + type=dict, |
| 666 | + is_optional=True, |
| 667 | + is_list=True, |
| 668 | + nested_model="CodeDescription", |
| 669 | + ), |
| 670 | + "important_dates": FieldSchema( |
| 671 | + name="important_dates", type=dict, is_optional=True, is_list=True |
| 672 | + ), |
| 673 | + "attachments": FieldSchema( |
| 674 | + name="attachments", |
| 675 | + type=dict, |
| 676 | + is_optional=True, |
| 677 | + is_list=True, |
| 678 | + nested_model="GrantAttachment", |
| 679 | + ), |
| 680 | +} |
| 681 | + |
| 682 | + |
591 | 683 | # ============================================================================ |
592 | 684 | # SCHEMA REGISTRY MAPPING |
593 | 685 | # ============================================================================ |
|
610 | 702 | "Opportunity": OPPORTUNITY_SCHEMA, |
611 | 703 | "Notice": NOTICE_SCHEMA, |
612 | 704 | "Agency": AGENCY_SCHEMA, |
| 705 | + "Grant": GRANT_SCHEMA, |
| 706 | + # Nested schemas for Grant fields |
| 707 | + "CFDANumber": CFDA_NUMBER_SCHEMA, |
| 708 | + "CodeDescription": CODE_DESCRIPTION_SCHEMA, |
| 709 | + "GrantAttachment": GRANT_ATTACHMENT_SCHEMA, |
613 | 710 | } |
614 | 711 |
|
615 | 712 |
|
|
0 commit comments