001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.purap.fixtures;
017:
018: import org.kuali.core.util.KualiDecimal;
019: import org.kuali.module.purap.document.RequisitionDocument;
020:
021: public enum RequisitionDocumentFixture {
022:
023: REQ_ONLY_REQUIRED_FIELDS(
024: null, // requisitionOrganizationReference1Text
025: null, // requisitionOrganizationReference2Text
026: null, // requisitionOrganizationReference3Text
027: null, // alternate1VendorName
028: null, // alternate2VendorName
029: null, // alternate3VendorName
030: null, // alternate4VendorName
031: null, // alternate5VendorName
032: null, // organizationAutomaticPurchaseOrderLimit
033: PurchasingAccountsPayableDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purapDocumentFixture
034: PurchasingDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purchasingDocumentFixture
035: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_QTY_UNRESTRICTED_ITEM_1 } // requisitionItemMultiFixtures
036: ),
037:
038: REQ_NO_APO_VALID(
039: null, // requisitionOrganizationReference1Text
040: null, // requisitionOrganizationReference2Text
041: null, // requisitionOrganizationReference3Text
042: null, // alternate1VendorName
043: null, // alternate2VendorName
044: null, // alternate3VendorName
045: null, // alternate4VendorName
046: null, // alternate5VendorName
047: null, // organizationAutomaticPurchaseOrderLimit
048: PurchasingAccountsPayableDocumentFixture.REQ_VALID_APO, // purapDocumentFixture
049: PurchasingDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purchasingDocumentFixture
050: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_ITEM_NO_APO } // requisitionItemMultiFixtures
051: ),
052:
053: REQ_APO_VALID(
054: null, // requisitionOrganizationReference1Text
055: null, // requisitionOrganizationReference2Text
056: null, // requisitionOrganizationReference3Text
057: null, // alternate1VendorName
058: null, // alternate2VendorName
059: null, // alternate3VendorName
060: null, // alternate4VendorName
061: null, // alternate5VendorName
062: null, // organizationAutomaticPurchaseOrderLimit
063: PurchasingAccountsPayableDocumentFixture.REQ_VALID_APO, // purapDocumentFixture
064: PurchasingDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purchasingDocumentFixture
065: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_QTY_UNRESTRICTED_ITEM_1 } // requisitionItemMultiFixtures
066: ), REQ_MULTI_QUANTITY(
067: null, // requisitionOrganizationReference1Text
068: null, // requisitionOrganizationReference2Text
069: null, // requisitionOrganizationReference3Text
070: null, // alternate1VendorName
071: null, // alternate2VendorName
072: null, // alternate3VendorName
073: null, // alternate4VendorName
074: null, // alternate5VendorName
075: null, // organizationAutomaticPurchaseOrderLimit
076: PurchasingAccountsPayableDocumentFixture.REQ_MULTI_QUANTITY, // purapDocumentFixture
077: PurchasingDocumentFixture.REQ_MULTI, // purchasingDocumentFixture
078: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_MULTI_ITEM_QUANTITY } // requisitionItemMultiFixtures
079: ), REQ_MULTI_NON_QUANTITY(
080: null, // requisitionOrganizationReference1Text
081: null, // requisitionOrganizationReference2Text
082: null, // requisitionOrganizationReference3Text
083: null, // alternate1VendorName
084: null, // alternate2VendorName
085: null, // alternate3VendorName
086: null, // alternate4VendorName
087: null, // alternate5VendorName
088: null, // organizationAutomaticPurchaseOrderLimit
089: PurchasingAccountsPayableDocumentFixture.REQ_MULTI_NON_QUANTITY, // purapDocumentFixture
090: PurchasingDocumentFixture.REQ_MULTI, // purchasingDocumentFixture
091: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_MULTI_ITEM_NON_QUANTITY } // requisitionItemMultiFixtures
092: ), REQ_ALTERNATE_APO(null, // requisitionOrganizationReference1Text
093: null, // requisitionOrganizationReference2Text
094: null, // requisitionOrganizationReference3Text
095: null, // alternate1VendorName
096: null, // alternate2VendorName
097: null, // alternate3VendorName
098: null, // alternate4VendorName
099: null, // alternate5VendorName
100: null, // organizationAutomaticPurchaseOrderLimit
101: PurchasingAccountsPayableDocumentFixture.REQ_ALTERNATE_APO, // purapDocumentFixture
102: PurchasingDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purchasingDocumentFixture
103: new RequisitionItemFixture[] {
104: RequisitionItemFixture.REQ_QTY_APO_ITEM_1,
105: RequisitionItemFixture.REQ_SERVICE_APO_ITEM_1,
106: RequisitionItemFixture.REQ_FREIGHT_ITEM_1 } // requisitionItemMultiFixtures
107: ),
108:
109: REQ_APO_INVALID_ALTERNATE_VENDOR_NAMES(
110: null, // requisitionOrganizationReference1Text
111: null, // requisitionOrganizationReference2Text
112: null, // requisitionOrganizationReference3Text
113: "NFL Shop", // alternate1VendorName
114: "Dicks Sporting Goods", // alternate2VendorName
115: null, // alternate3VendorName
116: null, // alternate4VendorName
117: null, // alternate5VendorName
118: null, // organizationAutomaticPurchaseOrderLimit
119: PurchasingAccountsPayableDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purapDocumentFixture
120: PurchasingDocumentFixture.REQ_ONLY_REQUIRED_FIELDS, // purchasingDocumentFixture
121: new RequisitionItemFixture[] { RequisitionItemFixture.REQ_QTY_UNRESTRICTED_ITEM_1 } // requisitionItemMultiFixtures
122: );
123:
124: public final String requisitionOrganizationReference1Text;
125: public final String requisitionOrganizationReference2Text;
126: public final String requisitionOrganizationReference3Text;
127: public final String alternate1VendorName;
128: public final String alternate2VendorName;
129: public final String alternate3VendorName;
130: public final String alternate4VendorName;
131: public final String alternate5VendorName;
132: public final KualiDecimal organizationAutomaticPurchaseOrderLimit;
133: private PurchasingAccountsPayableDocumentFixture purapDocumentFixture;
134: private PurchasingDocumentFixture purchasingDocumentFixture;
135: private RequisitionItemFixture[] requisitionItemFixtures;
136:
137: private RequisitionDocumentFixture(
138: String requisitionOrganizationReference1Text,
139: String requisitionOrganizationReference2Text,
140: String requisitionOrganizationReference3Text,
141: String alternate1VendorName,
142: String alternate2VendorName,
143: String alternate3VendorName,
144: String alternate4VendorName,
145: String alternate5VendorName,
146: KualiDecimal organizationAutomaticPurchaseOrderLimit,
147: PurchasingAccountsPayableDocumentFixture purapDocumentFixture,
148: PurchasingDocumentFixture purchasingDocumentFixture,
149: RequisitionItemFixture[] requisitionItemFixtures) {
150: this .requisitionOrganizationReference1Text = requisitionOrganizationReference1Text;
151: this .requisitionOrganizationReference2Text = requisitionOrganizationReference2Text;
152: this .requisitionOrganizationReference3Text = requisitionOrganizationReference3Text;
153: this .alternate1VendorName = alternate1VendorName;
154: this .alternate2VendorName = alternate2VendorName;
155: this .alternate3VendorName = alternate3VendorName;
156: this .alternate4VendorName = alternate4VendorName;
157: this .alternate5VendorName = alternate5VendorName;
158: this .organizationAutomaticPurchaseOrderLimit = organizationAutomaticPurchaseOrderLimit;
159: this .purapDocumentFixture = purapDocumentFixture;
160: this .purchasingDocumentFixture = purchasingDocumentFixture;
161: this .requisitionItemFixtures = requisitionItemFixtures;
162: }
163:
164: public RequisitionDocument createRequisitionDocument() {
165: RequisitionDocument doc = purchasingDocumentFixture
166: .createRequisitionDocument(purapDocumentFixture);
167: doc
168: .setRequisitionOrganizationReference1Text(this .requisitionOrganizationReference1Text);
169: doc
170: .setRequisitionOrganizationReference2Text(this .requisitionOrganizationReference2Text);
171: doc
172: .setRequisitionOrganizationReference3Text(this .requisitionOrganizationReference3Text);
173: doc.setAlternate1VendorName(this .alternate1VendorName);
174: doc.setAlternate2VendorName(this .alternate2VendorName);
175: doc.setAlternate3VendorName(this .alternate3VendorName);
176: doc.setAlternate4VendorName(this .alternate4VendorName);
177: doc.setAlternate5VendorName(this .alternate5VendorName);
178: doc
179: .setOrganizationAutomaticPurchaseOrderLimit(this .organizationAutomaticPurchaseOrderLimit);
180:
181: for (RequisitionItemFixture requisitionItemFixture : requisitionItemFixtures) {
182: requisitionItemFixture.addTo(doc);
183: }
184:
185: return doc;
186: }
187:
188: }
|