diff --git a/api/TallySheetVersionApi/TallySheetVersion_PRE_34_CO_Api.py b/api/TallySheetVersionApi/TallySheetVersion_PRE_34_CO_Api.py new file mode 100644 index 00000000..f66d391b --- /dev/null +++ b/api/TallySheetVersionApi/TallySheetVersion_PRE_34_CO_Api.py @@ -0,0 +1,47 @@ +from app import db +from auth import authorize, EC_LEADERSHIP_ROLE +from auth.AuthConstants import DATA_EDITOR_ROLE +from exception import NotFoundException +from orm.entities.Submission import TallySheet +from orm.entities.SubmissionVersion import TallySheetVersion +from orm.enums import TallySheetCodeEnum +from schemas import TallySheetVersion_PRE_34_CO_Schema, TallySheetVersionSchema +from util import RequestBody + + +@authorize(required_roles=[DATA_EDITOR_ROLE, EC_LEADERSHIP_ROLE]) +def get_by_id(tallySheetId, tallySheetVersionId): + tallySheet = TallySheet.get_by_id(tallySheetId=tallySheetId) + if tallySheet is None: + raise NotFoundException("Tally sheet not found. (tallySheetId=%d)" % tallySheetId) + + result = TallySheetVersion.get_by_id( + tallySheetId=tallySheetId, + tallySheetVersionId=tallySheetVersionId + ) + + return TallySheetVersion_PRE_34_CO_Schema().dump(result).data + + +@authorize(required_roles=[DATA_EDITOR_ROLE]) +def create(tallySheetId, body): + request_body = RequestBody(body) + tallySheet, tallySheetVersion = TallySheet.create_latest_version( + tallySheetId=tallySheetId, + tallySheetCode=TallySheetCodeEnum.PRE_34_CO + ) + tallySheetVersion.set_complete() # TODO: valid before setting complete. Refer to PRE_34_CO + tally_sheet_content = request_body.get("content") + if tally_sheet_content is not None: + for row in tally_sheet_content: + party_count_body = RequestBody(row) + tallySheetVersion.add_row( + electionId=tallySheetVersion.submission.electionId, + candidateId=party_count_body.get("candidateId"), + preferenceCount=party_count_body.get("preferenceCount"), + preferenceNumber=party_count_body.get("preferenceNumber"), + ) + + db.session.commit() + + return TallySheetVersionSchema().dump(tallySheetVersion).data diff --git a/migrations/versions/1c10a1181f81_.py b/migrations/versions/1c10a1181f81_.py new file mode 100644 index 00000000..494855d5 --- /dev/null +++ b/migrations/versions/1c10a1181f81_.py @@ -0,0 +1,28 @@ +"""empty message + +Revision ID: 1c10a1181f81 +Revises: f3d6ad1fdd31 +Create Date: 2019-10-31 15:19:30.297761 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '1c10a1181f81' +down_revision = 'f3d6ad1fdd31' +branch_labels = None +depends_on = None + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.add_column('election_candidate', sa.Column('qualifiedForPreferences', sa.Boolean(), nullable=False)) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_column('election_candidate', 'qualifiedForPreferences') + ### end Alembic commands ### diff --git a/migrations/versions/f3d6ad1fdd31_.py b/migrations/versions/f3d6ad1fdd31_.py new file mode 100644 index 00000000..e18bf686 --- /dev/null +++ b/migrations/versions/f3d6ad1fdd31_.py @@ -0,0 +1,40 @@ +"""empty message + +Revision ID: f3d6ad1fdd31 +Revises: 46e1b58e2e67 +Create Date: 2019-10-31 14:26:47.708066 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'f3d6ad1fdd31' +down_revision = '46e1b58e2e67' +branch_labels = None +depends_on = None + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.create_table('tallySheetVersionRow_PRE_34_Preference', + sa.Column('tallySheetVersionRowId', sa.Integer(), nullable=False), + sa.Column('tallySheetVersionId', sa.Integer(), nullable=False), + sa.Column('electionId', sa.Integer(), nullable=False), + sa.Column('candidateId', sa.Integer(), nullable=True), + sa.Column('preferenceNumber', sa.Integer(), nullable=False), + sa.Column('preferenceCount', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['candidateId'], ['candidate.candidateId'], ), + sa.ForeignKeyConstraint(['electionId'], ['election.electionId'], ), + sa.ForeignKeyConstraint(['tallySheetVersionId'], ['tallySheetVersion.tallySheetVersionId'], ), + sa.PrimaryKeyConstraint('tallySheetVersionRowId'), + sa.UniqueConstraint('tallySheetVersionId', 'preferenceNumber', 'candidateId', name='TallySheetVersionRow_RejectedVoteCount_Model') + ) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_table('tallySheetVersionRow_PRE_34_Preference') + ### end Alembic commands ### diff --git a/orm/entities/Election/ElectionCandidate.py b/orm/entities/Election/ElectionCandidate.py index 78009207..bcc4b8b3 100644 --- a/orm/entities/Election/ElectionCandidate.py +++ b/orm/entities/Election/ElectionCandidate.py @@ -9,6 +9,7 @@ class ElectionCandidateModel(db.Model): electionId = db.Column(db.Integer, db.ForeignKey("election.electionId"), nullable=False) partyId = db.Column(db.Integer, db.ForeignKey(Party.Model.__table__.c.partyId), nullable=False) candidateId = db.Column(db.Integer, db.ForeignKey(Candidate.Model.__table__.c.candidateId), nullable=False) + qualifiedForPreferences = db.Column(db.Boolean, default=False, nullable=False) election = relationship("ElectionModel", foreign_keys=[electionId]) party = relationship(Party.Model, foreign_keys=[partyId]) diff --git a/orm/entities/Election/election_helper.py b/orm/entities/Election/election_helper.py index dc8c5079..30c27227 100644 --- a/orm/entities/Election/election_helper.py +++ b/orm/entities/Election/election_helper.py @@ -191,6 +191,9 @@ def get_object(election, row, row_key, data_key=None): TallySheet.create( tallySheetCode=TallySheetCodeEnum.CE_201, electionId=election.electionId, areaId=obj.areaId ) + TallySheet.create( + tallySheetCode=TallySheetCodeEnum.PRE_34_CO, electionId=election.electionId, areaId=obj.areaId + ) elif election.voteType is VoteTypeEnum.Postal: obj = CountingCentre.create( cell, electionId=election.electionId, @@ -202,6 +205,9 @@ def get_object(election, row, row_key, data_key=None): TallySheet.create( tallySheetCode=TallySheetCodeEnum.CE_201_PV, electionId=election.electionId, areaId=obj.areaId ) + TallySheet.create( + tallySheetCode=TallySheetCodeEnum.PRE_34_CO, electionId=election.electionId, areaId=obj.areaId + ) elif data_store_key == "Polling Station": obj = PollingStation.create( diff --git a/orm/entities/Submission/TallySheet/__init__.py b/orm/entities/Submission/TallySheet/__init__.py index 667f15e6..251347f9 100644 --- a/orm/entities/Submission/TallySheet/__init__.py +++ b/orm/entities/Submission/TallySheet/__init__.py @@ -162,7 +162,8 @@ def create_empty_version(tallySheetId, tallySheetCode=None): def create_version(tallySheetId, tallySheetCode=None): tallySheet = get_by_id(tallySheetId=tallySheetId, tallySheetCode=tallySheetCode) if tallySheet is None: - raise NotFoundException("Tally sheet not found. (tallySheetId=%d)" % tallySheetId) + raise NotFoundException( + "Tally sheet not found. (tallySheetId=%d, tallySheetCode=%s)" % (tallySheetId, tallySheetCode.name)) tallySheetVersion = tallySheet.create_version() diff --git a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_CO.py b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_CO.py new file mode 100644 index 00000000..15b89e46 --- /dev/null +++ b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_CO.py @@ -0,0 +1,125 @@ +from flask import render_template +from sqlalchemy.ext.hybrid import hybrid_property +from sqlalchemy import func, and_, or_ +from app import db +from orm.entities import Area, Candidate, Party, Election +from orm.entities.Election import ElectionCandidate +from orm.entities.SubmissionVersion import TallySheetVersion +from orm.entities.TallySheetVersionRow import TallySheetVersionRow_PRE_34_preference +from util import to_comma_seperated_num, sqlalchemy_num_or_zero +from orm.enums import TallySheetCodeEnum, AreaTypeEnum, VoteTypeEnum + + +class TallySheetVersion_PRE_34_CO_Model(TallySheetVersion.Model): + + def __init__(self, tallySheetId): + super(TallySheetVersion_PRE_34_CO_Model, self).__init__( + tallySheetId=tallySheetId + ) + + __mapper_args__ = { + 'polymorphic_identity': TallySheetCodeEnum.PRE_34_CO + } + + def add_row(self, preferenceNumber, preferenceCount, candidateId, electionId): + from orm.entities.TallySheetVersionRow import TallySheetVersionRow_PRE_34_preference + + TallySheetVersionRow_PRE_34_preference.create( + tallySheetVersionId=self.tallySheetVersionId, + electionId=electionId, + preferenceNumber=preferenceNumber, + preferenceCount=preferenceCount, + candidateId=candidateId + ) + + @hybrid_property + def content(self): + + return db.session.query( + ElectionCandidate.Model.candidateId, + Candidate.Model.candidateName, + Party.Model.partySymbol, + TallySheetVersionRow_PRE_34_preference.Model.preferenceNumber, + TallySheetVersionRow_PRE_34_preference.Model.preferenceCount, + TallySheetVersionRow_PRE_34_preference.Model.tallySheetVersionId, + TallySheetVersionRow_PRE_34_preference.Model.electionId + ).join( + TallySheetVersionRow_PRE_34_preference.Model, + and_( + TallySheetVersionRow_PRE_34_preference.Model.candidateId == ElectionCandidate.Model.candidateId, + TallySheetVersionRow_PRE_34_preference.Model.tallySheetVersionId == self.tallySheetVersionId, + ), + isouter=True + ).join( + Candidate.Model, + Candidate.Model.candidateId == ElectionCandidate.Model.candidateId, + isouter=True + ).join( + Party.Model, + Party.Model.partyId == ElectionCandidate.Model.partyId, + isouter=True + ).filter( + ElectionCandidate.Model.electionId.in_(self.submission.election.mappedElectionIds), + ElectionCandidate.Model.qualifiedForPreferences == True + ).all() + + def html(self): + stamp = self.stamp + + polling_divisions = Area.get_associated_areas(self.submission.area, AreaTypeEnum.PollingDivision) + polling_division_name = "" + if len(polling_divisions) > 0: + polling_division_name = polling_divisions[0].areaName + + content = { + "election": { + "electionName": self.submission.election.get_official_name() + }, + "stamp": { + "createdAt": stamp.createdAt, + "createdBy": stamp.createdBy, + "barcodeString": stamp.barcodeString + }, + "title": "PRESIDENTIAL ELECTION ACT NO. 15 OF 1981", + "electoralDistrict": Area.get_associated_areas( + self.submission.area, AreaTypeEnum.ElectoralDistrict)[0].areaName, + "pollingDivision": polling_division_name, + "countingCentre": self.submission.area.areaName, + "pollingDistrictNos": ", ".join([ + pollingDistrict.areaName for pollingDistrict in + Area.get_associated_areas(self.submission.area, AreaTypeEnum.PollingDistrict) + ]), + "data": [ + ], + } + + # for row_index in range(len(tallySheetContent)): + # row = tallySheetContent[row_index] + # if row.count is not None: + # content["data"].append([ + # row_index + 1, + # row.candidateName, + # row.partySymbol, + # row.preferenceNumber, + # to_comma_seperated_num(row.count), + # "" + # ]) + # else: + # content["data"].append([ + # row_index + 1, + # row.candidateName, + # row.partySymbol, + # "", + # "", + # "" + # ]) + + html = render_template( + 'PRE-34-CO.html', + content=content + ) + + return html + + +Model = TallySheetVersion_PRE_34_CO_Model diff --git a/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_34_preference.py b/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_34_preference.py new file mode 100644 index 00000000..1d6a0872 --- /dev/null +++ b/orm/entities/TallySheetVersionRow/TallySheetVersionRow_PRE_34_preference.py @@ -0,0 +1,53 @@ +from sqlalchemy.ext.associationproxy import association_proxy +from sqlalchemy.orm import relationship + +from app import db +from orm.entities import Area, Election, Candidate +from orm.entities.SubmissionVersion import TallySheetVersion + + +class TallySheetVersionRow_PRE_34_preference_Model(db.Model): + __tablename__ = 'tallySheetVersionRow_PRE_34_Preference' + tallySheetVersionRowId = db.Column(db.Integer, primary_key=True, autoincrement=True) + tallySheetVersionId = db.Column(db.Integer, db.ForeignKey(TallySheetVersion.Model.__table__.c.tallySheetVersionId), + nullable=False) + electionId = db.Column(db.Integer, db.ForeignKey(Election.Model.__table__.c.electionId), nullable=False) + candidateId = db.Column(db.Integer, db.ForeignKey(Candidate.Model.__table__.c.candidateId), nullable=True) + preferenceNumber = db.Column(db.Integer, nullable=False) + preferenceCount = db.Column(db.Integer, nullable=False) + + candidate = relationship(Candidate.Model, foreign_keys=[candidateId]) + election = relationship(Election.Model, foreign_keys=[electionId]) + + areaName = association_proxy("area", "areaName") + + __table_args__ = ( + db.UniqueConstraint('tallySheetVersionId', 'preferenceNumber', 'candidateId', + name='TallySheetVersionRow_RejectedVoteCount_Model'), + ) + + def __init__(self, electionId, tallySheetVersionId, preferenceNumber, preferenceCount, candidateId): + super(TallySheetVersionRow_PRE_34_preference_Model, self).__init__( + electionId=electionId, + tallySheetVersionId=tallySheetVersionId, + preferenceNumber=preferenceNumber, + preferenceCount=preferenceCount, + candidateId=candidateId + ) + db.session.add(self) + db.session.flush() + + +Model = TallySheetVersionRow_PRE_34_preference_Model + + +def create(electionId, tallySheetVersionId, preferenceNumber, preferenceCount, candidateId): + result = Model( + electionId=electionId, + tallySheetVersionId=tallySheetVersionId, + preferenceNumber=preferenceNumber, + preferenceCount=preferenceCount, + candidateId=candidateId + ) + + return result diff --git a/schemas/__init__.py b/schemas/__init__.py index f0e3f64f..9ee8ddb6 100644 --- a/schemas/__init__.py +++ b/schemas/__init__.py @@ -2,18 +2,18 @@ from app import db, ma from orm.entities import StationaryItem, Ballot, Invoice, BallotBox, \ - Election, Proof, Submission, Electorate, SubmissionVersion, Area, Party, BallotBook -from orm.entities.Election import InvalidVoteCategory + Election, Proof, Submission, Electorate, SubmissionVersion, Area, Party, BallotBook, Candidate +from orm.entities.Election import InvalidVoteCategory, ElectionCandidate from orm.entities.IO import File from orm.entities.Invoice import InvoiceStationaryItem from orm.entities.SubmissionVersion import TallySheetVersion from orm.entities.Submission import TallySheet from orm.entities.SubmissionVersion.TallySheetVersion import TallySheetVersionCE201, TallySheetVersionPRE41, \ - TallySheetVersionPRE21, TallySheetVersion_PRE_30_PD, TallySheetVersion_PRE_30_ED, \ + TallySheetVersionPRE21, TallySheetVersion_PRE_30_PD, TallySheetVersion_PRE_30_ED, TallySheetVersion_PRE_34_CO, \ TallySheetVersion_PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS, TallySheetVersion_PRE_ALL_ISLAND_RESULT, \ TallySheetVersion_CE_201_PV from orm.entities.TallySheetVersionRow import TallySheetVersionRow_CE_201_PV, TallySheetVersionRow_CE_201, \ - TallySheetVersionRow_PRE_41, \ + TallySheetVersionRow_PRE_41, TallySheetVersionRow_PRE_34_preference, \ TallySheetVersionRow_PRE_21, TallySheetVersionRow_PRE_ALL_ISLAND_RESULT, TallySheetVersionRow_PRE_30_ED, \ TallySheetVersionRow_PRE_30_PD, TallySheetVersionRow_CE_201_PV_CC, TallySheetVersionRow_RejectedVoteCount, \ TallySheetVersionRow_PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS @@ -47,10 +47,11 @@ class Meta: fields = ( "candidateId", "candidateName", - "candidateProfileImageFile" + "candidateProfileImageFile", + "qualifiedForPreferences" ) - model = Party.Model + model = ElectionCandidate.Model # optionally attach a Session # to use for deserialization sqla_session = db.session @@ -195,6 +196,20 @@ class Meta: # to use for deserialization sqla_session = db.session +class TallySheetVersionRow_PRE_34_CO_Schema(ma.ModelSchema): + class Meta: + fields = ( + "electionId", + "tallySheetVersionId", + "preferenceNumber", + "preferenceCount", + "candidateId" + ) + + model = TallySheetVersionRow_PRE_34_preference.Model + # optionally attach a Session + # to use for deserialization + sqla_session = db.session class TallySheetVersionRow_PRE_30_PD_Schema(ma.ModelSchema): class Meta: @@ -562,6 +577,24 @@ class Meta: content = ma.Nested(TallySheetVersionRow_PRE_30_ED_Schema, many=True) areas = ma.Nested(AreaSchema, many=True) +class TallySheetVersion_PRE_34_CO_Schema(ma.ModelSchema): + class Meta: + fields = ( + "tallySheetId", + "tallySheetVersionId", + "createdBy", + "createdAt", + "htmlUrl", + "content" + ) + + model = TallySheetVersion_PRE_34_CO.Model + # optionally attach a Session + # to use for deserialization + sqla_session = db.session + + # submission = ma.Nested(SubmissionSchema) + content = ma.Nested(TallySheetVersionRow_PRE_34_CO_Schema, many=True) class TallySheetVersion_PRE_30_PD_Schema(ma.ModelSchema): class Meta: diff --git a/swagger.yml b/swagger.yml index 9470ae4b..f690a9ea 100644 --- a/swagger.yml +++ b/swagger.yml @@ -14,33 +14,33 @@ info: url: 'http://www.apache.org/licenses/LICENSE-2.0.html' tags: - - name: Tally Sheet - description: Access to tally sheets - - name: Invoice - description: Access to invoices - - name: Stationary - description: Access to stationaries - - name: Invoice Stationary - description: Access to stationaries - - name: System Testing - description: Endpoints required for testing purpose only. These are to be removed. +- name: Tally Sheet + description: Access to tally sheets +- name: Invoice + description: Access to invoices +- name: Stationary + description: Access to stationaries +- name: Invoice Stationary + description: Access to stationaries +- name: System Testing + description: Endpoints required for testing purpose only. These are to be removed. paths: /system-testing/election/{electionId}/root-token: get: tags: - - System Testing + - System Testing summary: Get all. operationId: api.ElectionApi.getRootToken parameters: - - name: electionId - in: path - description: Election ID - required: true - schema: - type: integer - format: int64 + - name: electionId + in: path + description: Election ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -77,16 +77,16 @@ paths: /election/{electionId}: get: tags: - - Election + - Election summary: Get By Id operationId: api.ElectionApi.get_by_id parameters: - - name: electionId - in: path - required: true - schema: - type: integer - format: int64 + - name: electionId + in: path + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -95,8 +95,8 @@ paths: schema: type: object required: - - electionId - - electionName + - electionId + - electionName properties: electionId: type: integer @@ -169,16 +169,16 @@ paths: /election/{electionId}/area: get: tags: - - Election + - Election summary: Get by ID operationId: api.ElectionApi.get_all_areas parameters: - - name: electionId - required: true - in: path - schema: - type: integer - format: int64 + - name: electionId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -214,24 +214,24 @@ paths: /election: get: tags: - - Election + - Election summary: Get all. operationId: api.ElectionApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 responses: '200': description: Successful operation. @@ -242,8 +242,8 @@ paths: items: type: object required: - - electionId - - electionName + - electionId + - electionName properties: electionId: type: integer @@ -315,7 +315,7 @@ paths: post: tags: - - Election + - Election summary: Create election operationId: api.ElectionApi.create requestBody: @@ -344,11 +344,11 @@ paths: type: string format: binary required: - - electionName - - pollingStationsDataset - - invalidVoteCategoriesDataset - - partyCandidatesDataset - - postalCountingCentresDataset + - electionName + - pollingStationsDataset + - invalidVoteCategoriesDataset + - partyCandidatesDataset + - postalCountingCentresDataset responses: '200': description: Successful operation. @@ -359,8 +359,8 @@ paths: items: type: object required: - - electionId - - electionName + - electionId + - electionName properties: electionId: type: integer @@ -433,43 +433,43 @@ paths: /ballot: get: tags: - - Stationary + - Stationary summary: Get all. operationId: api.BallotApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 - - name: ballotId - required: false - in: query - schema: - type: string - - name: ballotType - required: false - in: query - schema: - type: string - enum: - - Ordinary - - Tendered + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 + - name: ballotId + required: false + in: query + schema: + type: string + - name: ballotType + required: false + in: query + schema: + type: string + enum: + - Ordinary + - Tendered responses: '200': description: Successful operation. @@ -480,9 +480,9 @@ paths: items: type: object required: - - ballotId - - stationaryItemId - - electionId + - ballotId + - stationaryItemId + - electionId properties: ballotId: type: string @@ -495,8 +495,8 @@ paths: ballotType: type: string enum: - - Ordinary - - Tendered + - Ordinary + - Tendered '400': description: Bad request. content: @@ -524,7 +524,7 @@ paths: post: tags: - - Stationary + - Stationary summary: Create. operationId: api.BallotApi.create responses: @@ -535,9 +535,9 @@ paths: schema: type: object required: - - ballotId - - stationaryItemId - - electionId + - ballotId + - stationaryItemId + - electionId properties: ballotId: type: string @@ -550,8 +550,8 @@ paths: ballotType: type: string enum: - - Ordinary - - Tendered + - Ordinary + - Tendered '400': description: Bad request. content: @@ -582,8 +582,8 @@ paths: schema: type: object required: - - ballotId - - electionId + - ballotId + - electionId properties: ballotId: type: string @@ -593,38 +593,38 @@ paths: ballotType: type: string enum: - - Ordinary - - Tendered + - Ordinary + - Tendered description: Ballot Object. required: True /ballot-book: get: tags: - - Stationary + - Stationary summary: Get all. operationId: api.BallotBookApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -635,10 +635,10 @@ paths: items: type: object required: - - stationaryItemId - - fromBallotId - - toBallotId - - electionId + - stationaryItemId + - fromBallotId + - toBallotId + - electionId properties: fromBallotId: type: string @@ -677,7 +677,7 @@ paths: post: tags: - - Stationary + - Stationary summary: Create. operationId: api.BallotBookApi.create responses: @@ -688,10 +688,10 @@ paths: schema: type: object required: - - stationaryItemId - - fromBallotId - - toBallotId - - electionId + - stationaryItemId + - fromBallotId + - toBallotId + - electionId properties: fromBallotId: type: string @@ -733,9 +733,9 @@ paths: schema: type: object required: - - fromBallotId - - toBallotId - - electionId + - fromBallotId + - toBallotId + - electionId properties: fromBallotId: type: string @@ -750,35 +750,35 @@ paths: /ballot-box: get: tags: - - Stationary + - Stationary summary: Get all. operationId: api.BallotBoxApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 - - name: ballotBoxId - required: false - in: query - schema: - type: string + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 + - name: ballotBoxId + required: false + in: query + schema: + type: string responses: '200': description: Successful operation. @@ -789,9 +789,9 @@ paths: items: type: object required: - - ballotBoxId - - stationaryItemId - - electionId + - ballotBoxId + - stationaryItemId + - electionId properties: ballotBoxId: type: string @@ -828,7 +828,7 @@ paths: post: tags: - - Stationary + - Stationary summary: Create. operationId: api.BallotBoxApi.create responses: @@ -839,9 +839,9 @@ paths: schema: type: object required: - - ballotBoxId - - stationaryItemId - - electionId + - ballotBoxId + - stationaryItemId + - electionId properties: ballotBoxId: type: string @@ -881,8 +881,8 @@ paths: schema: type: object required: - - ballotBoxId - - electionId + - ballotBoxId + - electionId properties: ballotBoxId: type: string @@ -895,54 +895,54 @@ paths: /invoice: get: tags: - - Invoice + - Invoice summary: Get all. operationId: api.InvoiceApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 - - name: issuingOfficeId - required: false - in: query - schema: - type: integer - format: int64 - - name: receivingOfficeId - required: false - in: query - schema: - type: integer - format: int64 - - name: issuedBy - required: false - in: query - schema: - type: integer - format: int64 - - name: issuedTo - required: false - in: query - schema: - type: integer - format: int64 + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 + - name: issuingOfficeId + required: false + in: query + schema: + type: integer + format: int64 + - name: receivingOfficeId + required: false + in: query + schema: + type: integer + format: int64 + - name: issuedBy + required: false + in: query + schema: + type: integer + format: int64 + - name: issuedTo + required: false + in: query + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -953,14 +953,14 @@ paths: items: type: object required: - - invoiceId - - electionId - - issuingOfficeId - - receivingOfficeId - - issuedBy - - issuedTo - - issuedAt - - confirmed + - invoiceId + - electionId + - issuingOfficeId + - receivingOfficeId + - issuedBy + - issuedTo + - issuedAt + - confirmed properties: invoiceId: type: integer @@ -1012,7 +1012,7 @@ paths: post: tags: - - Invoice + - Invoice summary: Create. operationId: api.InvoiceApi.create responses: @@ -1023,14 +1023,14 @@ paths: schema: type: object required: - - invoiceId - - electionId - - issuingOfficeId - - receivingOfficeId - - issuedBy - - issuedTo - - issuedAt - - confirmed + - invoiceId + - electionId + - issuingOfficeId + - receivingOfficeId + - issuedBy + - issuedTo + - issuedAt + - confirmed properties: invoiceId: type: integer @@ -1085,10 +1085,10 @@ paths: schema: type: object required: - - electionId - - issuingOfficeId - - receivingOfficeId - - issuedTo + - electionId + - issuingOfficeId + - receivingOfficeId + - issuedTo properties: electionId: type: integer @@ -1108,16 +1108,16 @@ paths: /invoice/{invoiceId}: get: tags: - - Invoice + - Invoice summary: Create. operationId: api.InvoiceApi.get_by_id parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1126,14 +1126,14 @@ paths: schema: type: object required: - - invoiceId - - electionId - - issuingOfficeId - - receivingOfficeId - - issuedBy - - issuedTo - - issuedAt - - confirmed + - invoiceId + - electionId + - issuingOfficeId + - receivingOfficeId + - issuedBy + - issuedTo + - issuedAt + - confirmed properties: invoiceId: type: integer @@ -1185,16 +1185,16 @@ paths: delete: tags: - - Invoice + - Invoice summary: Create. operationId: api.InvoiceApi.delete parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1230,16 +1230,16 @@ paths: /invoice/{invoiceId}/confirm: put: tags: - - Invoice + - Invoice summary: Create. operationId: api.InvoiceApi.confirm parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1248,14 +1248,14 @@ paths: schema: type: object required: - - invoiceId - - electionId - - issuingOfficeId - - receivingOfficeId - - issuedBy - - issuedTo - - issuedAt - - confirmed + - invoiceId + - electionId + - issuingOfficeId + - receivingOfficeId + - issuedBy + - issuedTo + - issuedAt + - confirmed properties: invoiceId: type: integer @@ -1308,60 +1308,60 @@ paths: /invoice/stationary-item: get: tags: - - Invoice Stationary + - Invoice Stationary summary: Get all. operationId: api.InvoiceStationaryItemApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: invoiceId - required: false - in: query - schema: - type: integer - format: int64 - - name: stationaryItemId - required: false - in: query - schema: - type: integer - format: int64 - - name: received - required: false - in: query - schema: - type: integer - format: int64 - - name: receivedBy - required: false - in: query - schema: - type: integer - format: int64 - - name: receivedFrom - required: false - in: query - schema: - type: integer - format: int64 - - name: receivedOffice - required: false - in: query - schema: - type: integer - format: int64 + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: invoiceId + required: false + in: query + schema: + type: integer + format: int64 + - name: stationaryItemId + required: false + in: query + schema: + type: integer + format: int64 + - name: received + required: false + in: query + schema: + type: integer + format: int64 + - name: receivedBy + required: false + in: query + schema: + type: integer + format: int64 + - name: receivedFrom + required: false + in: query + schema: + type: integer + format: int64 + - name: receivedOffice + required: false + in: query + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1372,13 +1372,13 @@ paths: items: type: object required: - - invoiceId - - stationaryItemId - - received - - receivedBy - - receivedFrom - - receivedOfficeId - - receivedAt + - invoiceId + - stationaryItemId + - received + - receivedBy + - receivedFrom + - receivedOfficeId + - receivedAt properties: invoiceId: type: integer @@ -1433,16 +1433,16 @@ paths: /invoice/{invoiceId}/stationary-item: post: tags: - - Invoice Stationary + - Invoice Stationary summary: Create. operationId: api.InvoiceStationaryItemApi.create parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1451,9 +1451,9 @@ paths: schema: type: object required: - - invoiceId - - stationaryItemId - - received + - invoiceId + - stationaryItemId + - received properties: invoiceId: type: integer @@ -1510,7 +1510,7 @@ paths: schema: type: object required: - - stationaryItemId + - stationaryItemId properties: stationaryItemId: type: integer @@ -1521,22 +1521,22 @@ paths: /invoice/{invoiceId}/stationary-item/{stationaryItemId}: get: tags: - - Invoice Stationary + - Invoice Stationary summary: Get all. operationId: api.InvoiceStationaryItemApi.get_by_id parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 - - name: stationaryItemId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 + - name: stationaryItemId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1545,13 +1545,13 @@ paths: schema: type: object required: - - invoiceId - - stationaryItemId - - received - - receivedBy - - receivedFrom - - receivedOfficeId - - receivedAt + - invoiceId + - stationaryItemId + - received + - receivedBy + - receivedFrom + - receivedOfficeId + - receivedAt properties: invoiceId: type: integer @@ -1605,22 +1605,22 @@ paths: delete: tags: - - Invoice Stationary + - Invoice Stationary summary: Get all. operationId: api.InvoiceStationaryItemApi.delete parameters: - - name: invoiceId - required: true - in: path - schema: - type: integer - format: int64 - - name: stationaryItemId - required: true - in: path - schema: - type: integer - format: int64 + - name: invoiceId + required: true + in: path + schema: + type: integer + format: int64 + - name: stationaryItemId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1656,7 +1656,7 @@ paths: /invoice/stationary-item/receive: put: tags: - - Invoice Stationary + - Invoice Stationary summary: Create. operationId: api.InvoiceStationaryItemApi.receive responses: @@ -1742,7 +1742,7 @@ paths: /proof/upload: put: tags: - - Proof + - Proof summary: Upload a proof. operationId: api.ProofApi.upload_file responses: @@ -1794,16 +1794,16 @@ paths: /proof/{proofId}/finish: put: tags: - - Proof + - Proof summary: Create. operationId: api.ProofApi.finish parameters: - - name: proofId - required: true - in: path - schema: - type: integer - format: int64 + - name: proofId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1839,16 +1839,16 @@ paths: /proof/{proofId}: get: tags: - - Proof + - Proof summary: Create. operationId: api.ProofApi.get_by_id parameters: - - name: proofId - required: true - in: path - schema: - type: integer - format: int64 + - name: proofId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -1884,16 +1884,16 @@ paths: /file/{fileId}: get: tags: - - Files + - Files summary: Get by ID operationId: api.FileApi.get_by_id parameters: - - name: fileId - required: true - in: path - schema: - type: integer - format: int64 + - name: fileId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -1925,16 +1925,16 @@ paths: /file/{fileId}/inline: get: tags: - - Files + - Files summary: Get by ID operationId: api.FileApi.get_inline_file parameters: - - name: fileId - required: true - in: path - schema: - type: integer - format: int64 + - name: fileId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -1970,16 +1970,16 @@ paths: /file/{fileId}/download: get: tags: - - Files + - Files summary: Get by ID operationId: api.FileApi.get_download_file parameters: - - name: fileId - required: true - in: path - schema: - type: integer - format: int64 + - name: fileId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -2015,53 +2015,53 @@ paths: /area: get: tags: - - Area + - Area summary: Get by ID operationId: api.AreaApi.get_all parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 - - name: associatedAreaId - required: false - in: query - schema: - type: integer - format: int64 - - name: areaType - required: false - in: query - schema: - type: string - enum: - - ElectionCommission - - DistrictCentre - - CountingCentre - - PostalVoteCountingCentre - - PollingStation - - Country - - Province - - AdministrativeDistrict - - ElectoralDistrict - - PollingDivision - - PollingDistrict + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 + - name: associatedAreaId + required: false + in: query + schema: + type: integer + format: int64 + - name: areaType + required: false + in: query + schema: + type: string + enum: + - ElectionCommission + - DistrictCentre + - CountingCentre + - PostalVoteCountingCentre + - PollingStation + - Country + - Province + - AdministrativeDistrict + - ElectoralDistrict + - PollingDivision + - PollingDistrict responses: '200': description: OK @@ -2097,56 +2097,57 @@ paths: /tally-sheet: get: tags: - - Tally Sheet + - Tally Sheet summary: Get all the tally sheets. operationId: api.TallySheetApi.getAll parameters: - - name: limit - in: query - description: Limit of the result array. - required: false - schema: - type: integer - default: 20 - - name: offset - in: query - description: Offset of the result array. - required: false - schema: - type: integer - default: 0 - - name: electionId - required: false - in: query - schema: - type: integer - format: int64 - - name: areaId - required: false - in: query - schema: - type: integer - format: int64 - - name: createdBy - required: false - in: query - schema: - type: integer - format: int64 - - name: tallySheetCode - required: false - in: query - schema: - type: string - enum: - - CE-201 - - CE-201-PV - - PRE-41 - - PRE-21 - - PRE-30-PD - - PRE-30-ED - - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS - - PRE-ALL-ISLAND-RESULTS + - name: limit + in: query + description: Limit of the result array. + required: false + schema: + type: integer + default: 20 + - name: offset + in: query + description: Offset of the result array. + required: false + schema: + type: integer + default: 0 + - name: electionId + required: false + in: query + schema: + type: integer + format: int64 + - name: areaId + required: false + in: query + schema: + type: integer + format: int64 + - name: createdBy + required: false + in: query + schema: + type: integer + format: int64 + - name: tallySheetCode + required: false + in: query + schema: + type: string + enum: + - CE-201 + - CE-201-PV + - PRE-41 + - PRE-21 + - PRE-30-PD + - PRE-30-ED + - PRE-34-CO + - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS + - PRE-ALL-ISLAND-RESULTS responses: '200': description: Successful operation. @@ -2157,9 +2158,9 @@ paths: items: type: object required: - - electionId - - officeId - - tallySheetCode + - electionId + - officeId + - tallySheetCode properties: id: type: integer @@ -2187,14 +2188,14 @@ paths: tallySheetCode: type: string enum: - - CE-201 - - CE-201-PV - - PRE-41 - - PRE-21 - - PRE-30-PD - - PRE-30-ED - - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS - - PRE-ALL-ISLAND-RESULTS + - CE-201 + - CE-201-PV + - PRE-41 + - PRE-21 + - PRE-30-PD + - PRE-30-ED + - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS + - PRE-ALL-ISLAND-RESULTS '400': description: Bad request. content: @@ -2223,16 +2224,16 @@ paths: /tally-sheet/{tallySheetId}: get: tags: - - Tally Sheet + - Tally Sheet summary: Get tally sheet by ID operationId: api.TallySheetApi.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: string + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: string responses: '200': description: Successful operation. @@ -2241,9 +2242,9 @@ paths: schema: type: object required: - - electionId - - officeId - - tallySheetCode + - electionId + - officeId + - tallySheetCode properties: id: type: integer @@ -2271,14 +2272,14 @@ paths: tallySheetCode: type: string enum: - - CE-201 - - CE-201-PV - - PRE-41 - - PRE-21 - - PRE-30-PD - - PRE-30-ED - - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS - - PRE-ALL-ISLAND-RESULTS + - CE-201 + - CE-201-PV + - PRE-41 + - PRE-21 + - PRE-30-PD + - PRE-30-ED + - PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS + - PRE-ALL-ISLAND-RESULTS '400': description: Bad request. content: @@ -2307,17 +2308,17 @@ paths: /tally-sheet/PRE-41/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersionPRE41Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2326,8 +2327,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -2376,8 +2377,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -2401,24 +2402,24 @@ paths: /tally-sheet/PRE-41/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersionPRE41Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2427,8 +2428,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -2475,17 +2476,17 @@ paths: /tally-sheet/PRE-21/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersionPRE21Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2494,7 +2495,7 @@ paths: schema: type: object required: - - content + - content properties: content: type: array @@ -2539,7 +2540,7 @@ paths: schema: type: object required: - - content + - content properties: content: type: array @@ -2557,24 +2558,24 @@ paths: /tally-sheet/PRE-21/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersionPRE21Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2610,17 +2611,17 @@ paths: /tally-sheet/CE-201/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersionCE201Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2629,7 +2630,7 @@ paths: schema: type: object required: - - content + - content properties: content: type: array @@ -2701,7 +2702,7 @@ paths: schema: type: object required: - - content + - content properties: content: type: array @@ -2748,24 +2749,24 @@ paths: /tally-sheet/CE-201/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersionCE201Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2774,7 +2775,7 @@ paths: schema: type: object required: - - content + - content properties: content: type: array @@ -2844,17 +2845,17 @@ paths: /tally-sheet/CE-201-PV/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersion_CE_201_PV_Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2863,8 +2864,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -2924,8 +2925,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -2958,24 +2959,24 @@ paths: /tally-sheet/CE-201-PV/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersion_CE_201_PV_Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -2984,8 +2985,8 @@ paths: schema: type: object required: - - content - - summary + - content + - summary properties: content: type: array @@ -3043,17 +3044,17 @@ paths: /tally-sheet/PRE-30-PD/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_30_PD_Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3088,24 +3089,24 @@ paths: /tally-sheet/PRE-30-PD/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_30_PD_Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3141,17 +3142,17 @@ paths: /tally-sheet/PRE-30-ED/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_30_ED_Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3186,24 +3187,143 @@ paths: /tally-sheet/PRE-30-ED/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_30_ED_Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '400': + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '404': + description: Resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '500': + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + + /tally-sheet/PRE-34-CO/{tallySheetId}/version: + post: + tags: + - Tally Sheet Version + summary: Create tally sheet version + operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_34_CO_Api.create + parameters: + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + type: object + required: + - content + properties: + content: + type: array + items: + type: object + properties: + candidateId: + type: integer + format: int64 + preferenceCount: + type: integer + preferencNumber: + type: integer + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: object + '400': + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '404': + description: Resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '500': + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + + /tally-sheet/PRE-34-CO/{tallySheetId}/version/{tallySheetVersionId}: + get: + tags: + - Tally Sheet Version + summary: Get tally sheet version by ID + operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_34_CO_Api.get_by_id + parameters: + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3239,17 +3359,17 @@ paths: /tally-sheet/PRE-ALL-ISLAND-RESULTS/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_ALL_ISLAND_RESULT_Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3284,24 +3404,24 @@ paths: /tally-sheet/PRE-ALL-ISLAND-RESULTS/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_ALL_ISLAND_RESULT_Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3337,17 +3457,17 @@ paths: /tally-sheet/PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS/{tallySheetId}/version: post: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Create tally sheet version operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS_Api.create parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3382,24 +3502,24 @@ paths: /tally-sheet/PRE-ALL-ISLAND-RESULTS-BY-ELECTORAL-DISTRICTS/{tallySheetId}/version/{tallySheetVersionId}: get: tags: - - Tally Sheet Version + - Tally Sheet Version summary: Get tally sheet version by ID operationId: api.TallySheetVersionApi.TallySheetVersion_PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS_Api.get_by_id parameters: - - name: tallySheetId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 - - name: tallySheetVersionId - in: path - description: Tally sheet ID - required: true - schema: - type: integer - format: int64 + - name: tallySheetId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 + - name: tallySheetVersionId + in: path + description: Tally sheet ID + required: true + schema: + type: integer + format: int64 responses: '200': description: Successful operation. @@ -3435,22 +3555,22 @@ paths: /tally-sheet/{tallySheetId}/version/{tallySheetVersionId}/html: get: tags: - - Tally Sheet Version Export + - Tally Sheet Version Export summary: Get by ID operationId: api.TallySheetVersionApi.html parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 - - name: tallySheetVersionId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 + - name: tallySheetVersionId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -3486,16 +3606,16 @@ paths: /tally-sheet/{tallySheetId}/empty/html: get: tags: - - Tally Sheet Version Export + - Tally Sheet Version Export summary: Get by ID operationId: api.TallySheetVersionApi.create_empty_and_get_html parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -3531,16 +3651,16 @@ paths: /tally-sheet/{tallySheetId}/lock: put: tags: - - Tally Sheet + - Tally Sheet summary: Get by ID operationId: api.TallySheetApi.lock parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -3578,7 +3698,7 @@ paths: schema: type: object required: - - lockedVersionId + - lockedVersionId properties: lockedVersionId: type: integer @@ -3587,16 +3707,16 @@ paths: /tally-sheet/{tallySheetId}/unlock: put: tags: - - Tally Sheet + - Tally Sheet summary: Get by ID operationId: api.TallySheetApi.unlock parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -3632,16 +3752,16 @@ paths: /tally-sheet/{tallySheetId}/submit: put: tags: - - Tally Sheet + - Tally Sheet summary: Get by ID operationId: api.TallySheetApi.submit parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK @@ -3679,7 +3799,7 @@ paths: schema: type: object required: - - submittedVersionId + - submittedVersionId properties: submittedVersionId: type: integer @@ -3688,16 +3808,16 @@ paths: /tally-sheet/{tallySheetId}/request-edit: put: tags: - - Tally Sheet + - Tally Sheet summary: Get by ID operationId: api.TallySheetApi.request_edit parameters: - - name: tallySheetId - required: true - in: path - schema: - type: integer - format: int64 + - name: tallySheetId + required: true + in: path + schema: + type: integer + format: int64 responses: '200': description: OK diff --git a/templates/PRE-34-CO.html b/templates/PRE-34-CO.html index ff5c08d2..188a24cc 100644 --- a/templates/PRE-34-CO.html +++ b/templates/PRE-34-CO.html @@ -97,13 +97,13 @@